public void DeleteGame(string code) { Game.Game gm = null; if (Matches.TryGetValue(code, out gm)) { gm.StopGameEngine(); Matches.Remove(code); } Matches.Remove(code); }
public bool TryAddGame(InitialisingInfo initInfo, out Game.Game gm) { gm = null; if (Matches.Count < _GamesLimit) { initInfo.GameCode = GenerateCode(); initInfo.GameName = String.IsNullOrEmpty(initInfo.GameName) ? "Unnamed" : initInfo.GameName; //("Game_" + Matches.Count) gm = new Game.Game(initInfo.GameCode, initInfo.GameName, initInfo.GameMode, initInfo.PlayersLimit, templateCollection); Matches.Add(gm.Code, gm); return(true); } return(false); }
public bool TryGetGame(string code, out Game.Game gm) { return(Matches.TryGetValue(code, out gm)); }