Esempio n. 1
0
        public void TakeFoodIsFalseTest()
        {
            var eatMatrix = new FoodMatrix(2, 2, new FillingFromCornersByWavesStrategy());
            var point     = new Point(0, 0);

            Assert.IsFalse(eatMatrix.TakeFood(point));
        }
Esempio n. 2
0
 public void Eat(FoodMatrix eatMatrix)
 {
     if (eatMatrix.TakeFood(Position))
     {
         _energyPoints += CreatureConstants.OneBite;
     }
 }
Esempio n. 3
0
        public void TakeFoodIsTrueTest()
        {
            var eatMatrix = new FoodMatrix(2, 2, new FillingFromCornersByWavesStrategy());
            var point     = new Point(0, 0);

            FrequentlyUsedMethods.RaiseFoodLevelToConstantWithAddFood(eatMatrix, point, CreatureConstants.OneBite);

            Assert.IsTrue(eatMatrix.HasOneBite(point));

            var counter = FoodMatrixConstants.AddedFoodLevel / CreatureConstants.OneBite;

            for (int i = 0; i < counter; i++)
            {
                Assert.IsTrue(eatMatrix.TakeFood(point));
            }

            Assert.IsFalse(eatMatrix.HasOneBite(point));
        }
Esempio n. 4
0
        public void TakeFoodIsTrueTest()
        {
            var eatMatrix = new FoodMatrix(2, 2, new FillingFromCornersByWavesStrategy());
            var point = new Point(0, 0);

            FrequentlyUsedMethods.RaiseFoodLevelToConstantWithAddFood(eatMatrix, point, CreatureConstants.OneBite);

            Assert.IsTrue(eatMatrix.HasOneBite(point));

            var counter = FoodMatrixConstants.AddedFoodLevel / CreatureConstants.OneBite;
            for (int i = 0; i < counter; i++)
            {
                Assert.IsTrue(eatMatrix.TakeFood(point));
            }

            Assert.IsFalse(eatMatrix.HasOneBite(point));
        }
Esempio n. 5
0
 public void TakeFoodIsFalseTest()
 {
     var eatMatrix = new FoodMatrix(2, 2, new FillingFromCornersByWavesStrategy());
     var point = new Point(0, 0);
     Assert.IsFalse(eatMatrix.TakeFood(point));
 }