public override AcceptanceReport CanDesignateCell(IntVec3 c)
        {
            if (!c.InBounds(base.Map))
            {
                return(false);
            }
            if (c.Fogged(base.Map))
            {
                return(false);
            }
            if (base.Map.designationManager.DesignationAt(c, DesignationDefOf.SmoothFloor) != null)
            {
                return("TerrainBeingSmoothed".Translate());
            }
            if (c.InNoBuildEdgeArea(base.Map))
            {
                return("TooCloseToMapEdge".Translate());
            }
            Building edifice = c.GetEdifice(base.Map);

            if (edifice != null && !SmoothFloorDesignatorUtility.CanSmoothFloorUnder(edifice))
            {
                return(false);
            }
            TerrainDef terrain = c.GetTerrain(base.Map);

            if (!terrain.affordances.Contains(TerrainAffordance.SmoothableStone))
            {
                return("MessageMustDesignateSmoothableFloor".Translate());
            }
            return(AcceptanceReport.WasAccepted);
        }
예제 #2
0
 public static void Notify_BuildingSpawned(Building b)
 {
     if (!SmoothFloorDesignatorUtility.CanSmoothFloorUnder(b))
     {
         CellRect.CellRectIterator iterator = b.OccupiedRect().GetIterator();
         while (!iterator.Done())
         {
             Designation designation = b.Map.designationManager.DesignationAt(iterator.Current, DesignationDefOf.SmoothFloor);
             if (designation != null)
             {
                 b.Map.designationManager.RemoveDesignation(designation);
             }
             iterator.MoveNext();
         }
     }
 }