예제 #1
1
 // Kills the game - returns true if there was an active game to begin with
 internal bool KillGame()
 {
     if (_game != null) {
         _ticker.Change(Timeout.Infinite, Timeout.Infinite);
         try { _game.Dispose(); }
         catch (Exception ex) { GameChannel.Out(GameDisplayName, ex.ToString()); }
         _game = null;
         _gameDispName = null;
         GC.Collect();
         UpdateTopic(null);
         return true;
     }
     return false;
 }
예제 #2
0
 // Creates an instance of the game corresponding to the given startup command (without prefix)
 public bool CreateInstance(string cmd, out GcGame gameInstance, out string displayName)
 {
     GameInfo info = _games.SingleOrDefault(g => g.StartCommand.ToLower() == cmd.ToLower());
     if (info == null) {
         gameInstance = null;
         displayName = null;
         return false;
     } else {
         gameInstance = (GcGame)info.GameAssembly.CreateInstance(info.EntryType);
         displayName = info.DisplayName;
         return true;
     }
 }