restructure
This commit is contained in:
30
Mau/CardDTO.cs
Normal file
30
Mau/CardDTO.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
namespace MauMau_Server.Mau;
|
||||
|
||||
public class CardDTO
|
||||
{
|
||||
public string CardType { get; set; }
|
||||
public string CardValue { get; set; }
|
||||
|
||||
public CardDTO(Card card)
|
||||
{
|
||||
CardType = card.CardType.ToString();
|
||||
CardValue = card.CardValue.ToString();
|
||||
}
|
||||
|
||||
public CardDTO(string cardType, string cardValue)
|
||||
{
|
||||
CardType = cardType;
|
||||
CardValue = cardValue;
|
||||
}
|
||||
|
||||
public CardDTO()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Card ToCard()
|
||||
{
|
||||
return new Card((CardType)Enum.Parse(typeof(CardType), CardType),
|
||||
(CardValue)Enum.Parse(typeof(CardValue), CardValue));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user