public void RoadManagerTestsCheckIfNeighbourIsRoadOnGridFalse() { var position = new Vector3Int(0, 0, 0); var result = RoadManager.CheckIfNeighborHasRoadOnTheGrid(_grid, position); Assert.IsFalse(result); }
private void RevokeStructureRemovalPlacementAt(Vector3Int gridPositionInt, GameObject structure) { _placementManager.ResetBuildingLook(structure); _structuresToBeModified.Remove(gridPositionInt); if (RoadManager.CheckIfNeighborHasRoadOnTheGrid(_grid, gridPositionInt) && _roadsToBeRemoved.ContainsKey(gridPositionInt)) { _roadsToBeRemoved.Remove(gridPositionInt); } }
private void AddStructureForRemoval(Vector3Int gridPositionInt, GameObject structure) { _structuresToBeModified.Add(gridPositionInt, structure); _placementManager.SetBuildingForRemoval(structure); if (RoadManager.CheckIfNeighborHasRoadOnTheGrid(_grid, gridPositionInt) && _roadsToBeRemoved.ContainsKey(gridPositionInt) == false) { _roadsToBeRemoved.Add(gridPositionInt, structure); } }
private void AdjustStructureIfIsOnGrid(Vector3Int?neighborGridPosition, Vector3Int neighborPositionInt) { if (RoadManager.CheckIfNeighborHasRoadOnTheGrid(_grid, neighborPositionInt)) { var neighborStructureData = _grid.GetStructureDataFromTheGrid(neighborGridPosition.Value); if (neighborStructureData != null && neighborStructureData.GetType() == typeof(RoadStructureSO) && _existingRoadStructuresToBeModified.ContainsKey(neighborPositionInt) == false) { _existingRoadStructuresToBeModified.Add(neighborPositionInt, _grid.GetStructureFromTheGrid(neighborGridPosition.Value)); } } }