Fixed accidentally building the board from player2 perspective.

This commit is contained in:
2021-04-06 19:52:02 -05:00
parent 2d5c6b20b9
commit 05a9c71499
45 changed files with 441 additions and 276 deletions

View File

@@ -0,0 +1,27 @@
using Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Types;
using BoardStatePiece = Gameboard.ShogiUI.Rules.Pieces.Piece;
namespace Gameboard.ShogiUI.Sockets.Models
{
public class Piece
{
public WhichPiece WhichPiece { get; set; }
public bool IsPromoted { get; set; }
public Piece(BoardStatePiece piece)
{
WhichPiece = (WhichPiece)piece.WhichPiece;
IsPromoted = piece.IsPromoted;
}
public ServiceModels.Socket.Types.Piece ToServiceModel()
{
return new ServiceModels.Socket.Types.Piece
{
IsPromoted = IsPromoted,
WhichPiece = WhichPiece
};
}
}
}