public void Simulate()
{
// Init
_highlightedLifelet = null;
_age++;
// Food
foreach(Food food in _food) {
food.Simulate();
}
// Messages
foreach(Message message in _messages) {
message.Simulate();
}
// Loop life forms
foreach(Lifelet life in _lifelets) {
// Simulate
life.PrepareSimulate();
life.Simulate();
// Check that the simulation was performed properly
if(life.DidSimulate != true) {
throw new Exception("Implementing class did not call base Simulate()!");
}
// Highlighted?
if(life.Distance(new Vector(_cursor.X,_cursor.Y)) < Config.DisplayMouseSensitivity) _highlightedLifelet = life;
}
}