예제 #1
0
        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;
        }
예제 #2
0
        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;
        }