protected Game() { Colors = new string[] { "R", "B", "G", "Y", "O", "P", "C", "M" }; CodeLength = Colors.Length; Gamekey = ""; _matermindMatch = _matermindMatch == null ? new MastermindMatch() : _matermindMatch; }
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"]); }
public Game(IMastermindMatch mastermindMatch) : this() { _matermindMatch = mastermindMatch; }