before deleting Rules
This commit is contained in:
26
Gameboard.ShogiUI.Rules/Pieces/Pawn.cs
Normal file
26
Gameboard.ShogiUI.Rules/Pieces/Pawn.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user