Exemple #1
0
        public static void EndGame(Game.Player Winner, Game.Player Loser, GameResult result = GameResult.ALL_SHIPS_SUNK)
        {
            var game = Winner.Game;

            Winner.RemotePlayer.EndGame(BoardOwner.ME, result);
            if (result != GameResult.PLAYER_DISCONNECTED)
            {
                Loser.RemotePlayer.EndGame(BoardOwner.ENEMY, result);
            }
            lock (Games)
            {
                Games.Remove(game);
            }
            game = null;
            GC.Collect(); //just in case
        }