Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 3
0
        private static bool Cleaner(Building building)
        {
            ((Factory) building).pollutionFactor = 0.0;

            return true;
        }
Ejemplo n.º 4
0
        private static bool Clean(Building building)
        {
            //It's worth it to check to see if the polution factor isn't already 0, just in case.
            if (((Factory) building).pollutionFactor > .5)
                ((Factory) building).pollutionFactor = .5;

            return true;
        }
Ejemplo n.º 5
0
        private static bool Add5(Building building)
        {
            ((Factory) building).EarnMoney(5);

            return false;
        }
Ejemplo n.º 6
0
        private static bool StandardEffect(Building building)
        {
            ResearchCenter thisCenter = (ResearchCenter)building;
            if (thisCenter.IsActive) {
                thisCenter.TaskComplete();
            }

            return true;
        }