コード例 #1
0
ファイル: Server.cs プロジェクト: sander3991/SecretHitler
 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;
 }
コード例 #2
0
ファイル: Server.cs プロジェクト: sander3991/SecretHitler
 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);
 }
コード例 #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);
     };
 }