Files
Shogi/Gameboard.ShogiUI.Rules/Pieces/Lance.cs
2021-05-08 10:26:04 -05:00

27 lines
613 B
C#

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