コード例 #1
1
ファイル: GameManager.cs プロジェクト: Rafa652/GameChannel
 // 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
ファイル: Loader.cs プロジェクト: Rafa652/GameChannel
 // 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;
     }
 }