Пример #1
0
            public static void EatFood(Organism organism, Grid grid, TimeManager timeManager)
            {
                var food = organism.DestinationTile.Inhabitant as Food;

                if (timeManager.HasSimulationTicked) // It's rare but two organisms can attempt to eat the same food source and the type preference is indifferent
                {
                    if (food != null)
                    {
                        food.BeEaten();
                        organism.Eat(); //organism gets fuller after eating
                    }
                }
            }