This commit is contained in:
2022-11-09 08:56:54 -06:00
parent 2241ab23fe
commit 3257b420e9
17 changed files with 601 additions and 538 deletions

View File

@@ -6,10 +6,6 @@ namespace Shogi.Domain.ValueObjects
[DebuggerDisplay("{WhichPiece} {Owner}")]
public abstract record class Piece
{
/// <summary>
/// Creates a clone of an existing piece.
/// </summary>
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
@@ -54,7 +50,7 @@ namespace Shogi.Domain.ValueObjects
}
/// <summary>
/// Respecting the move-set of the Piece, collect all positions from start to end.
/// Respecting the move-set of the Piece, collect all positions along the shortest path from start to end.
/// Useful if you need to iterate a move-set.
/// </summary>
/// <param name="start"></param>