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); } }
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)); }
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); }
public BuildingDetails(bool CanBeBuiltOnUnevenTerrain, BuildingFootprint footprint) { this.CanBeBuiltOnUnevenTerrain = CanBeBuiltOnUnevenTerrain; this.footprint = footprint; }