before deleting Rules
This commit is contained in:
27
Gameboard.ShogiUI.Rules/Pieces/Knight.cs
Normal file
27
Gameboard.ShogiUI.Rules/Pieces/Knight.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using PathFinding;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Gameboard.ShogiUI.Rules.Pieces
|
||||
{
|
||||
public class Knight : Piece
|
||||
{
|
||||
private static readonly List<PathFinding.Move> Moves = new(2)
|
||||
{
|
||||
new PathFinding.Move(Direction.KnightLeft),
|
||||
new PathFinding.Move(Direction.KnightRight)
|
||||
};
|
||||
|
||||
public Knight(WhichPlayer owner) : base(WhichPiece.Knight, owner)
|
||||
{
|
||||
moveSet = new MoveSet(this, Moves);
|
||||
promotedMoveSet = new MoveSet(this, GoldenGeneral.Moves);
|
||||
}
|
||||
|
||||
public override Piece DeepClone()
|
||||
{
|
||||
var clone = new Knight(Owner);
|
||||
if (IsPromoted) clone.Promote();
|
||||
return clone;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user