public void RoadManagerTestsCheckIfNeighbourIsRoadOnGridFalse() { var position = new Vector3Int(0, 0, 0); var result = RoadManager.CheckIfNeighbourIsRoadOnTheGrid(grid, position); Assert.IsFalse(result); }
private void RevokeStructureDemolitionAt(Vector3Int gridPositionInt, GameObject structure) { placementManager.ResetBuildingLook(structure); structuresToBeModified.Remove(gridPositionInt); if (RoadManager.CheckIfNeighbourIsRoadOnTheGrid(grid, gridPositionInt) && roadToDemolish.ContainsKey(gridPositionInt)) { roadToDemolish.Remove(gridPositionInt); } }
private void AddStructureForDemolition(Vector3Int gridPositionInt, GameObject structure) { structuresToBeModified.Add(gridPositionInt, structure); placementManager.SetBuildingForDemolition(structure); if (RoadManager.CheckIfNeighbourIsRoadOnTheGrid(grid, gridPositionInt) && roadToDemolish.ContainsKey(gridPositionInt) == false) { roadToDemolish.Add(gridPositionInt, structure); } }
private void AdjustStructureIfIsOnGrid(Vector3Int?neighbourGridPosition, Vector3Int neighbourPositionInt) { if (RoadManager.CheckIfNeighbourIsRoadOnTheGrid(grid, neighbourPositionInt)) { var neighbourStructureData = grid.GetStructureDataFromTheGrid(neighbourGridPosition.Value); if (neighbourStructureData != null && neighbourStructureData.GetType() == typeof(RoadStructureSO) && existingRoadStructuresToModify.ContainsKey(neighbourPositionInt) == false) { existingRoadStructuresToModify.Add(neighbourPositionInt, grid.GetStructureFromTheGrid(neighbourGridPosition.Value)); } } }