Exemplo n.º 1
0
        protected bool Eat(int amount)
        {
            if (!ActionAllowed())
            {
                return(false);                  // ignore multiple actions by same ant
            }
            int val = MyColony.GetFoodFromStore(MotherNature.MAX_QUEEN_BITE_SIZE);

            energy += val * MotherNature.FOOD_TO_ENERGY;
            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Eat some food from my own bag, to build up energy, strength or toughness
        /// </summary>
        /// <param name="amount"></param>
        /// <returns></returns>
        protected bool EatFromStore(int amount, MotherNature.DigestionFor purpose)
        {
            if (!ActionAllowed())
            {
                return(false);                  // ignore multiple actions by same ant
            }
            if (!Helpers.IsInPolygon(MyColony.Hill, SDLocation))
            {
                return(false);                                                 // must be in the hill to eat from store
            }
            int val = MyColony.GetFoodFromStore(MAX_BITE_SIZE);

            Eat(val, purpose);
            return(true);
        }