28 lines
822 B
C#
28 lines
822 B
C#
using Shogi.Domain.YetToBeAssimilatedIntoDDD.Pathing;
|
|
using System.Collections.ObjectModel;
|
|
|
|
namespace Shogi.Domain.ValueObjects
|
|
{
|
|
internal record class King : Piece
|
|
{
|
|
internal static readonly ReadOnlyCollection<Path> KingPaths = new(new List<Path>(8)
|
|
{
|
|
new Path(Direction.Up),
|
|
new Path(Direction.Left),
|
|
new Path(Direction.Right),
|
|
new Path(Direction.Down),
|
|
new Path(Direction.UpLeft),
|
|
new Path(Direction.UpRight),
|
|
new Path(Direction.DownLeft),
|
|
new Path(Direction.DownRight)
|
|
});
|
|
|
|
public King(WhichPlayer owner, bool isPromoted = false)
|
|
: base(WhichPiece.King, owner, isPromoted)
|
|
{
|
|
}
|
|
|
|
public override IEnumerable<Path> MoveSet => KingPaths;
|
|
}
|
|
}
|