public void AddPlayer(Player _player) { Debug.Log($"Adding player"); players.Add(_player); gameBoard.AddPlayer(_player); Debug.Log($"After adding player : " + players.Count); }
public int MakeGuess(Player player) { var guess = currentGuess++; GameBoard.AddPlayer(guess, player); return(guess); }
public int MakeGuess(Player player) { var guess = GameHelper.GetRandom(); GameBoard.AddPlayer(guess, player); return(guess); }
public int MakeGuess(Player player) { while (!GameBoard.Contains(currentGuess)) { currentGuess++; GameBoard.AddPlayer(currentGuess, player); } return(currentGuess); }
public int MakeGuess(Player player) { var range = Enumerable.Range(GameConstants.LowerLimit, GameConstants.UpperLimit).Where(i => !GameBoard.Contains(i)); var index = new System.Random().Next(GameConstants.LowerLimit, GameConstants.UpperLimit + 1 - GameBoard.CountOfGuesses()); var guess = range.ElementAt(index); GameBoard.AddPlayer(guess, player); return(guess); }