Files
Shogi/Gameboard.ShogiUI.BoardState/Pieces/Pawn.cs

27 lines
588 B
C#

using PathFinding;
using System.Collections.Generic;
namespace Gameboard.ShogiUI.Rules.Pieces
{
public class Pawn : Piece
{
private static readonly List<PathFinding.Move> Moves = new(1)
{
new PathFinding.Move(Direction.Up)
};
public Pawn(WhichPlayer owner) : base(WhichPiece.Pawn, owner)
{
moveSet = new MoveSet(this, Moves);
promotedMoveSet = new MoveSet(this, GoldenGeneral.Moves);
}
public override Piece DeepClone()
{
var clone = new Pawn(Owner);
if (IsPromoted) clone.Promote();
return clone;
}
}
}