Example #1
0
 protected Game()
 {
     Colors          = new string[] { "R", "B", "G", "Y", "O", "P", "C", "M" };
     CodeLength      = Colors.Length;
     Gamekey         = "";
     _matermindMatch = _matermindMatch == null ? new MastermindMatch() : _matermindMatch;
 }
Example #2
0
        public void MatchCode(Player currentPlayer)
        {
            _matermindMatch = _matermindMatch ?? new MastermindMatch();
            var match = _matermindMatch.MatchGuessWithCode(Code, currentPlayer.Guess);

            Solved = match["match"] == 1;
            currentPlayer.AddPastResult(match["exact"], match["near"]);
        }
Example #3
0
 public Game(IMastermindMatch mastermindMatch) : this()
 {
     _matermindMatch = mastermindMatch;
 }