before deleting Rules

This commit is contained in:
2021-05-08 10:26:04 -05:00
parent 05a9c71499
commit f8f779e84c
80 changed files with 1109 additions and 832 deletions

View File

@@ -1,18 +1,25 @@
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; }
public WhichPlayer Owner { get; }
public WhichPiece WhichPiece { get; }
public bool IsPromoted { get; set; }
public Piece(BoardStatePiece piece)
public Piece(bool isPromoted, WhichPlayer owner, WhichPiece whichPiece)
{
IsPromoted = isPromoted;
Owner = owner;
WhichPiece = whichPiece;
}
public Piece(Rules.Pieces.Piece piece)
{
WhichPiece = (WhichPiece)piece.WhichPiece;
IsPromoted = piece.IsPromoted;
Owner = (WhichPlayer)piece.Owner;
WhichPiece = (WhichPiece)piece.WhichPiece;
}
public ServiceModels.Socket.Types.Piece ToServiceModel()
@@ -20,6 +27,7 @@ namespace Gameboard.ShogiUI.Sockets.Models
return new ServiceModels.Socket.Types.Piece
{
IsPromoted = IsPromoted,
Owner = Owner,
WhichPiece = WhichPiece
};
}