36 lines
839 B
C#
36 lines
839 B
C#
using Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Types;
|
|
|
|
namespace Gameboard.ShogiUI.Sockets.Models
|
|
{
|
|
public class Piece
|
|
{
|
|
public bool IsPromoted { get; }
|
|
public WhichPlayer Owner { get; }
|
|
public WhichPiece WhichPiece { get; }
|
|
|
|
public Piece(bool isPromoted, WhichPlayer owner, WhichPiece whichPiece)
|
|
{
|
|
IsPromoted = isPromoted;
|
|
Owner = owner;
|
|
WhichPiece = whichPiece;
|
|
}
|
|
|
|
public Piece(Rules.Pieces.Piece piece)
|
|
{
|
|
IsPromoted = piece.IsPromoted;
|
|
Owner = (WhichPlayer)piece.Owner;
|
|
WhichPiece = (WhichPiece)piece.WhichPiece;
|
|
}
|
|
|
|
public ServiceModels.Socket.Types.Piece ToServiceModel()
|
|
{
|
|
return new ServiceModels.Socket.Types.Piece
|
|
{
|
|
IsPromoted = IsPromoted,
|
|
Owner = Owner,
|
|
WhichPiece = WhichPiece
|
|
};
|
|
}
|
|
}
|
|
}
|