Files
Shogi/Shogi.Domain/ValueObjects/King.cs
2024-09-26 21:11:47 -05:00

28 lines
849 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.Forward),
new Path(Direction.Left),
new Path(Direction.Right),
new Path(Direction.Backward),
new Path(Direction.ForwardLeft),
new Path(Direction.ForwardRight),
new Path(Direction.BackwardLeft),
new Path(Direction.BackwardRight)
});
public King(WhichPlayer owner, bool isPromoted = false)
: base(WhichPiece.King, owner, isPromoted)
{
}
public override IEnumerable<Path> MoveSet => KingPaths;
}
}