Files
Shogi/Gameboard.ShogiUI.BoardState/Pieces/Pawn.cs
2021-03-04 20:35:23 -06:00

27 lines
593 B
C#

using PathFinding;
using System.Collections.Generic;
namespace Gameboard.ShogiUI.BoardState.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;
}
}
}