Esempio n. 1
0
        public static bool IsObjectPowered(string location, Vector2 tile, UtilityObject obj)
        {
            Vector2 waterPower    = GetTileWaterPower(location, tile);
            Vector2 electricPower = GetTileElectricPower(location, tile);

            if (obj.water < 0 && (waterPower == Vector2.Zero || waterPower.X + waterPower.Y < 0))
            {
                return(false);
            }
            if (obj.electric < 0 && (electricPower == Vector2.Zero || electricPower.X + electricPower.Y < 0))
            {
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
 public static bool ObjectNeedsPower(UtilityObject obj)
 {
     return(obj.water < 0 || obj.electric < 0);
 }
Esempio n. 3
0
 public UtilityObjectInstance(UtilityObject template, Object obj)
 {
     Template    = template;
     WorldObject = obj;
 }