예제 #1
0
        public void testGameStateConstructor() {
            byte numberOfPins = 4;
            byte numberOfColors = 4;
            byte numberOfTries = 4;
            bool computerIsPlaying = true;

            GameState newState = new GameState(numberOfTries, numberOfPins, numberOfColors, computerIsPlaying);

            Assert.AreEqual(computerIsPlaying, newState.ComputerIsPlaying);
            Assert.AreEqual(numberOfColors, newState.NrOfAvailableColors);
            Assert.AreEqual(numberOfTries, newState.NrOfTries);
            Assert.AreEqual(numberOfPins, newState.NrOfPins);
        }/*testGameStateConstructor*/
예제 #2
0
		} /*GameDateTime*/
		#endregion Properties

		#region Constructor
		public SavedGame(GameState game) {
			this.game = game;
			gameDateTime = DateTime.Now;
		} /*SavedGame*/
예제 #3
0
		} /*Mastermind*/

		public Mastermind(GameState settings) {
			gameState = settings;
			if (GameState.NrOfAvailableColors <= 8 && GameState.NrOfPins <= 8) {
				mSolver = new MastermindSolver(ref gameState);
			}
		} /*Mastermind*/