Files
Shogi/Gameboard.ShogiUI.Sockets/Repositories/CouchModels/Piece.cs

28 lines
654 B
C#

using Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Types;
namespace Gameboard.ShogiUI.Sockets.Repositories.CouchModels
{
public class Piece
{
public bool IsPromoted { get; set; }
public WhichPlayer Owner { get; set; }
public WhichPiece WhichPiece { get; set; }
/// <summary>
/// Default constructor and setters are for deserialization.
/// </summary>
public Piece()
{
}
public Piece(Models.Piece piece)
{
IsPromoted = piece.IsPromoted;
Owner = piece.Owner;
WhichPiece = piece.WhichPiece;
}
public Models.Piece ToDomainModel() => new(WhichPiece, Owner, IsPromoted);
}
}