IsNaturalRoughRockAt() public static method

public static IsNaturalRoughRockAt ( IntVec3 position ) : bool
position IntVec3
return bool
Example #1
0
        /// <summary>
        /// Check if a new fungiponics basin can be built at this location.
        /// - the fungiponics basin must be roofed.
        /// - must not be too near from another fungiponics basin.
        /// </summary>
        public override AcceptanceReport AllowsPlacing(BuildableDef checkingDef, IntVec3 loc, Rot4 rot)
        {
            foreach (IntVec3 cell in GenAdj.CellsOccupiedBy(loc, rot, checkingDef.Size))
            {
                if (ClusterPlant.IsNaturalRoughRockAt(cell) == false)
                {
                    return(new AcceptanceReport("Fungiponics basin must be built on rough rock."));
                }
                if (Find.RoofGrid.Roofed(loc) == false)
                {
                    return(new AcceptanceReport("Fungiponics basin must be roofed."));
                }
            }

            List <Thing>        fungiponicsBasinsList = new List <Thing>();
            IEnumerable <Thing> list = Find.ListerThings.ThingsOfDef(ThingDef.Named("FungiponicsBasin"));

            foreach (Thing basin in list)
            {
                fungiponicsBasinsList.Add(basin);
            }
            list = Find.ListerThings.ThingsOfDef(ThingDef.Named("FungiponicsBasin").blueprintDef);
            foreach (Thing basin in list)
            {
                fungiponicsBasinsList.Add(basin);
            }
            list = Find.ListerThings.ThingsOfDef(ThingDef.Named("FungiponicsBasin").frameDef);
            foreach (Thing basin in list)
            {
                fungiponicsBasinsList.Add(basin);
            }
            foreach (Thing basin in fungiponicsBasinsList)
            {
                if (basin.Position.InHorDistOf(loc, minDistanceBetweenFungiponicsBasins))
                {
                    return(new AcceptanceReport("An other fungiponics basin is too close."));
                }
            }

            return(true);
        }
Example #2
0
        /// <summary>
        /// Check if a new fungiponics basin can be built at this location.
        /// - the fungiponics basin must be roofed.
        /// - must not be too near from another fungiponics basin.
        /// </summary>
        public override AcceptanceReport AllowsPlacing(BuildableDef checkingDef, IntVec3 loc, Rot4 rot, Thing thingToIgnore = null)
        {
            foreach (IntVec3 cell in GenAdj.CellsOccupiedBy(loc, rot, checkingDef.Size))
            {
                if (ClusterPlant.IsNaturalRoughRockAt(base.Map, cell) == false)
                {
                    return(new AcceptanceReport("CaveworldFlora.MustOnRoughRock".Translate()));
                }
                if (base.Map.roofGrid.Roofed(loc) == false)
                {
                    return(new AcceptanceReport("CaveworldFlora.MustBeRoofed".Translate()));
                }
            }

            List <Thing>        fungiponicsBasinsList = new List <Thing>();
            IEnumerable <Thing> list = base.Map.listerThings.ThingsOfDef(ThingDef.Named("FungiponicsBasin"));

            foreach (Thing basin in list)
            {
                fungiponicsBasinsList.Add(basin);
            }
            list = base.Map.listerThings.ThingsOfDef(ThingDef.Named("FungiponicsBasin").blueprintDef);
            foreach (Thing basin in list)
            {
                fungiponicsBasinsList.Add(basin);
            }
            list = base.Map.listerThings.ThingsOfDef(ThingDef.Named("FungiponicsBasin").frameDef);
            foreach (Thing basin in list)
            {
                fungiponicsBasinsList.Add(basin);
            }
            foreach (Thing basin in fungiponicsBasinsList)
            {
                if (basin.Position.InHorDistOf(loc, minDistanceBetweenFungiponicsBasins))
                {
                    return(new AcceptanceReport("CaveworldFlora.TooClose".Translate()));
                }
            }

            return(true);
        }