示例#1
0
 public void SetFootprintOccupied(BuildingLocation location, BuildingFootprint footprint, bool value)
 {
     for (int i = 0; i < footprint.footprint.Length; i++)
     {
         SetCellOccupied(location.GetX() + footprint.footprint[i].x, location.GetZ() + footprint.footprint[i].z, value);
     }
 }
示例#2
0
        public bool CanPlaceBuildingAtLocation(Vector3 point, Transform building)
        {
            point = simMan.terrainManager.GetPointOnGrid(point);
            BuildingFootprint footprint = GetBuildingDetails(building.GetComponent <Building>().type).footprint;

            return(!simMan.terrainManager.CheckIfFootprintOccupied(point, footprint) && simMan.terrainManager.CheckIfFootprintFlat(point, footprint));
        }
示例#3
0
 public bool CheckIfFootprintOccupied(Vector3 point, BuildingFootprint footprint)
 {
     for (int i = 0; i < footprint.footprint.Length; i++)
     {
         if (CheckIfOccupied((int)point.x + footprint.footprint[i].x, (int)point.z + footprint.footprint[i].z))
         {
             return(true);
         }
     }
     return(false);
 }
示例#4
0
 public BuildingDetails(bool CanBeBuiltOnUnevenTerrain, BuildingFootprint footprint)
 {
     this.CanBeBuiltOnUnevenTerrain = CanBeBuiltOnUnevenTerrain;
     this.footprint = footprint;
 }