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