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