コード例 #1
0
ファイル: Middleware.cs プロジェクト: Azamat-tech/Durak-Game
        private async Task InformStartGame()
        {
            command = "StartGame";

            game.StartGame();
            List <WebSocket> playersPlaying = manager.GetPlayingSockets();
            GameView         gameView;

            string[] playerUserNames = game.GetUserNames();
            int[]    takenIcons      = game.GetIcons();

            for (int playerID = 0; playerID < playersPlaying.Count; playerID++)
            {
                gameView = new GameView(game, playerID);
                await SendJSON(playersPlaying[playerID], new
                {
                    command,
                    gameView,
                    playerUserNames,
                    takenIcons
                });
            }
        }