before deleting Rules
This commit is contained in:
@@ -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
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user