using PathFinding; using System.Collections.Generic; using System.Linq; using System.Numerics; namespace Gameboard.ShogiUI.BoardState.Pieces { public class Knight : Piece { private static readonly List MoveSet = new List(2) { new Path(Direction.KnightLeft), new Path(Direction.KnightRight) }; public Knight(WhichPlayer owner) : base(WhichPiece.Knight, owner) { } public override Piece DeepClone() { var clone = new Knight(Owner); if (IsPromoted) clone.Promote(); return clone; } public override ICollection GetPaths() { var moveSet = IsPromoted ? GoldenGeneral.MoveSet : MoveSet; return Owner == WhichPlayer.Player1 ? moveSet : moveSet.Select(_ => new Path(Vector2.Negate(_.Direction), _.Distance)).ToList(); } } }