This commit is contained in:
2021-12-29 22:11:49 -06:00
parent 9ec91615a3
commit 499e480851
4 changed files with 57 additions and 52 deletions

View File

@@ -61,6 +61,7 @@
{
board.InCheck = null;
}
board.WhoseTurn = otherPlayer;
}
///// <summary>

View File

@@ -19,7 +19,7 @@ namespace Shogi.Domain
public List<Piece> Player1Hand { get; }
public List<Piece> Player2Hand { get; }
public List<Move> MoveHistory { get; }
public WhichPlayer WhoseTurn => MoveHistory.Count % 2 == 0 ? WhichPlayer.Player1 : WhichPlayer.Player2;
public WhichPlayer WhoseTurn { get; set; }
public WhichPlayer? InCheck { get; set; }
public bool IsCheckmate { get; set; }

View File

@@ -51,7 +51,7 @@ namespace Shogi.Domain
var fromPiece = board[from];
if (fromPiece == null)
{
return new MoveResult(false, $"Tile [{from}] is empty. There is no piece to move.");
return new MoveResult(false, $"Tile [{fromNotation}] is empty. There is no piece to move.");
}
if (fromPiece.Owner != board.WhoseTurn)