Example #1
0
        public string JoinedGame(int id, string userId, string number)
        {
            var gameToJoin = this.games.GetById(id);

            gameToJoin.BlueUserId = userId;

            var gameState = randomProvider.GetRandomNumber(1, 2);

            gameToJoin.GameState      = (GameState)gameState;
            gameToJoin.BlueUserNumber = number;

            this.games.SaveChanges();

            return(gameToJoin.Name);
        }