Esempio n. 1
0
        public async Task StartGame()
        {
            Guid newGame = await mgr.CreateProcess();

            List <Task> promises = new List <Task>();

            for (int i = 0; i < players.Count; i++)
            {
                promises.Add(mgr.AddPlayer(newGame, players[i]));
            }
            await Task.WhenAll(promises);

            players.Clear();

            observers.Notify((o) => o.GameStart(newGame, 0));
            observers.Clear();

            await mgr.StartGame(newGame);
        }