checkpoint

This commit is contained in:
2025-09-05 18:13:35 -05:00
parent e2a8b771d9
commit 0a415a2292
24 changed files with 622 additions and 492 deletions

View File

@@ -0,0 +1,30 @@
using Shogi.Domain.ValueObjects.Movement;
using System.Collections.ObjectModel;
namespace Shogi.Domain.ValueObjects;
internal record class GoldGeneral : Piece
{
public static readonly ReadOnlyCollection<Path> Player1Paths = new(
[
new Path(Direction.Forward),
new Path(Direction.ForwardLeft),
new Path(Direction.ForwardRight),
new Path(Direction.Left),
new Path(Direction.Right),
new Path(Direction.Backward)
]);
public static readonly ReadOnlyCollection<Path> Player2Paths =
Player1Paths
.Select(p => p.Invert())
.ToList()
.AsReadOnly();
public GoldGeneral(WhichPlayer owner, bool isPromoted = false)
: base(WhichPiece.GoldGeneral, owner, isPromoted)
{
}
public override IEnumerable<Path> MoveSet => Owner == WhichPlayer.Player1 ? Player1Paths : Player2Paths;
}