Пример #1
0
        private Game CreateNewGame(IGameRepository gameRepository, params string[] userIds)
        {
            Guid gameID = Guid.NewGuid();

            Game game = new Game()
            {
                Id = gameID, ActiveUser = "******", GameActions = new List <GameAction>(), Users = new List <GameUser>()
            };

            foreach (string userId in userIds)
            {
                GameUser user = new GameUser()
                {
                    UserId = userId
                };
                game.Users.Add(user);
            }

            gameRepository.AddOrUpdateGame(game);

            return(game);
        }
Пример #2
0
        private Game CreateNewGame(IGameRepository gameRepository, params string[] userIds)
        {
            Guid gameID = Guid.NewGuid();

            Game game = new Game() { Id = gameID, ActiveUser = "******", GameActions = new List<GameAction>(), Users = new List<GameUser>() };

            foreach (string userId in userIds)
            {
                GameUser user = new GameUser() { UserId = userId };
                game.Users.Add(user);
            }

            gameRepository.AddOrUpdateGame(game);

            return game;
        }