checkpoint

This commit is contained in:
2022-06-12 12:37:32 -05:00
parent 2dcc6ca417
commit 4ca0b63564
43 changed files with 563 additions and 2128 deletions

View File

@@ -9,7 +9,7 @@ namespace Shogi.Domain.Pieces
/// <summary>
/// Creates a clone of an existing piece.
/// </summary>
public static Piece Create(Piece piece) => Create(piece.WhichPiece, piece.Owner, piece.IsPromoted);
public static Piece CreateCopy(Piece piece) => Create(piece.WhichPiece, piece.Owner, piece.IsPromoted);
public static Piece Create(WhichPiece piece, WhichPlayer owner, bool isPromoted = false)
{
return piece switch
@@ -25,8 +25,6 @@ namespace Shogi.Domain.Pieces
_ => throw new ArgumentException($"Unknown {nameof(WhichPiece)} when cloning a {nameof(Piece)}.")
};
}
// TODO: MoveSet doesn't account for Player2's pieces which are upside-down.
public abstract IEnumerable<Path> MoveSet { get; }
public WhichPiece WhichPiece { get; }
public WhichPlayer Owner { get; private set; }