private void AdjustStructureIfIsInDictionary(Vector3Int?neighbourGridPosition, Vector3Int neighbourPositionInt) { if (RoadManager.CheckIfNeighbourIsRoadInDictionary(neighbourPositionInt, structuresToBeModified)) { RevokeRoadPlacementAt(neighbourPositionInt); var neighboursStructure = RoadManager.GetCorrectRoadPrefab(neighbourGridPosition.Value, structureData, structuresToBeModified, grid); PlaceNewRoadAt(neighboursStructure, neighbourGridPosition.Value, neighbourPositionInt); } }
public void RoadManagerTestsCheckIfNeighbourIsRoadInDictionaryFalse() { var dictionary = new Dictionary <Vector3Int, GameObject>(); var position = new Vector3Int(3, 0, 6); dictionary.Add(position, roadStraight); var result = RoadManager.CheckIfNeighbourIsRoadInDictionary(new Vector3Int(6, 0, 6), dictionary); Assert.IsFalse(result); }