Ejemplo n.º 1
0
 public void DeleteGame(string code)
 {
     Game.Game gm = null;
     if (Matches.TryGetValue(code, out gm))
     {
         gm.StopGameEngine();
         Matches.Remove(code);
     }
     Matches.Remove(code);
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 public bool TryGetGame(string code, out Game.Game gm)
 {
     return(Matches.TryGetValue(code, out gm));
 }