restructure

This commit is contained in:
2023-03-21 09:41:48 +01:00
parent b7483d56a9
commit 1e4b69f83a
15 changed files with 3 additions and 3 deletions

28
Mau/GameState.cs Normal file
View File

@@ -0,0 +1,28 @@
namespace MauMau_Server.Mau;
public class GameState
{
public string PlayerName { get; set; }
public List<string> Hand { get; set; } = new();
public string CurrentCard { get; set; }
public string CurrentPlayer { get; set; }
public List<string> Players { get; set; } = new();
public GameState(Game game, string playerId)
{
var p = game.GetPlayer(playerId);
PlayerName = p.Name;
foreach (var card in p.Hand)
{
Hand.Add(card.ToString());
}
foreach (var player in game.Players)
{
Players.Add(player.Name);
}
CurrentCard = game.CurrentCard.ToString();
CurrentPlayer = game.CurrentPlayer.Name;
}
}