Esempio n. 1
0
 internal static Server GetInstance(Game game, GamePanel panel, Client client)
 {
     if (game == null)
         throw new ArgumentException("Game may not be null!", nameof(game));
     if (Instance == null)
         Instance = new Server(game, panel, client);
     return Instance;
 }
Esempio n. 2
0
 private Server(Game game, GamePanel panel, Client client)
 {
     this.game = game;
     GameState = new ServerGameState(this);
     for (var i = 1; i < 5; i++)
         GameState.SeatedPlayers[i] = Player.GetPlayerServerSide($"Temp {i}");
     ServerMessageHandler = new ServerMessageHandler(this, GameState);
 }
Esempio n. 3
0
 public ClientGameState(GamePanel panel, Client client, Game game, bool isHost)
     : base()
 {
     IsHost = isHost;
     Client = client;
     Chat = ChatHandler.Initialize(this);
     client.OnConnected += BindGetGamestate;
     panel.InitializePiles(DrawPile, DiscardPile);
     for (var i = 0; i < 17; i++)
         DrawPile.AddCard(new CardPolicyUnknown());
     Window = game;
     this.panel = panel;
     OnStart += (ClientGameState state) =>
     {
         state.FascistActions = FascistAction.GetActionsForPlayers(state.PlayerCount);
     };
 }