Пример #1
0
        public void ResetLevelTest()
        {
            GameLevel.SetLevel(10);
            GameLevel.ResetLevel();             // Set the level back to 1.

            Assert.AreEqual(1, GameLevel.GetLevel());
        }
Пример #2
0
 /// <summary>
 /// Increases the value of energy to make the player purchase less food.
 /// </summary>
 public static void IncreaseEnergyValue()
 {
     if (_energyValue <= 10)
     {
         _energyValue += _mineralValue - GameLevel.GetLevel();
     }
 }
Пример #3
0
 /// <summary>
 /// Increases the worth of food to compel the player to spend more in subsequent transactions.
 /// This method may be called when the player reaches a new level.
 /// </summary>
 public static void IncreaseMineralValue()
 {
     if (_mineralValue < 15) // IA - Limit the maximum exchange rate to 15 points.
     {
         _mineralValue += GameLevel.GetLevel() / 1.5;
     }
 }
Пример #4
0
        public void GetAndSetLevelTest()
        {
            GameLevel.SetLevel(2);
            Assert.AreEqual(2, GameLevel.GetLevel());

            GameLevel.SetLevel(25);
            Assert.AreEqual(25, GameLevel.GetLevel());
        }
Пример #5
0
        public void IncreaseLevelTest()
        {
            GameLevel.SetLevel(1);
            GameLevel.IncreaseLevel();             // Increase the level by one.

            Assert.AreEqual(2, GameLevel.GetLevel());

            GameLevel.SetLevel(50);
            GameLevel.IncreaseLevel();
            GameLevel.IncreaseLevel();
            GameLevel.IncreaseLevel();             // Call it three times to get 53.

            Assert.AreEqual(53, GameLevel.GetLevel());
        }