public Task Initialize(IGameControl control, IGameMessenger messenger, IGameModeData gameMode, Player[] players)
        {
            Control   = control;
            Messenger = messenger;
            Players.AddRange(players);

            return(InitGameMode(gameMode.Settings));
        }
Beispiel #2
0
 public async Task SetGameMode(Lobby lobby, IGameModeData mode)
 {
     log.Debug("setting gamemode of lobby " + lobby + " to " + mode.Name);
     using (var l = await lobby.Mutex.Lock())
     {
         /*lobby.GameSettings.Clear();
          * foreach(var s in mode.Settings)
          * {
          *  lobby.GameSettings.Add(s.Key, s.Value);
          * }*/
         lobby.SelectedGameMode = mode;
         await LobbyBroadcast(lobby, Messages.GameModeChanged(lobby));
         await UpdateLobbyConnections(lobby);
     }
 }