private static bool HealPeople(Building building, int range, int healthIncrement) { HealAnimation(building.GridLocation, range); foreach (Point p in building.GetRange()) { if (!World.InBound(p)) { continue; } foreach (Entity entity in World.GetEntities(p.X, p.Y)) { if (entity.Hidden) { continue; } if (entity is Person) { Person thisPerson = (Person)entity; thisPerson.Heal(healthIncrement); } } } return true; }
private static bool EducatePeople(Building building, int range, int educationIncrement) { EducateAnimation(building.GridLocation, range); foreach (Point p in building.GetRange()) { if (!World.InBound(p)) { continue; } foreach (Entity entity in World.GetEntities(p.X, p.Y)) { if (entity.Hidden) { continue; } if (entity is Person) { Person thisPerson = (Person) entity; if (!thisPerson.IsEducated) { thisPerson.Educate(educationIncrement); } } } } return true; }