示例#1
0
        public void TakeFoodIsFalseTest()
        {
            var eatMatrix = new FoodMatrix(2, 2, new FillingFromCornersByWavesStrategy());
            var point     = new Point(0, 0);

            Assert.IsFalse(eatMatrix.TakeFood(point));
        }
示例#2
0
 public void Eat(FoodMatrix eatMatrix)
 {
     if (eatMatrix.TakeFood(Position))
     {
         _energyPoints += CreatureConstants.OneBite;
     }
 }
示例#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));
        }
示例#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));
        }
示例#5
0
 public void TakeFoodIsFalseTest()
 {
     var eatMatrix = new FoodMatrix(2, 2, new FillingFromCornersByWavesStrategy());
     var point = new Point(0, 0);
     Assert.IsFalse(eatMatrix.TakeFood(point));
 }