Пример #1
0
 public static Game.Game GetGame(Player player, out Player opponent)
 {
     opponent = null;
     Game.Game foundGame = _games.Values.FirstOrDefault(g => g.Id == player.GameId);
     if (foundGame == null)
     {
         return(null);
     }
     opponent = (player.Id == foundGame.Player1.Id) ?
                foundGame.Player2 :
                foundGame.Player1;
     return(foundGame);
 }
Пример #2
0
 public static void AddGame(Game.Game game)
 {
     _games[game.Id] = game;
 }