public void RoadManagerTestsCheckIfNeighbourIsRoadInDictionaryCheckIfFourWayFitsR0() { var result = RoadManager.CheckIfFourwayRoadFits((int)Direction.Up | (int)Direction.Left | (int)Direction.Right | (int)Direction.Down, null, _roadSO); Assert.AreEqual(_road4Way, result.RoadPrefab); Assert.AreEqual(RotationValue.R0, result.RoadPrefabRotation); }
public static RoadStructureHelper GetCorrectRoadPrefab(Vector3 gridPosition, StructureBaseSO structureDat, Dictionary<Vector3Int, GameObject> structuresToBeModified, GridStructure grid) { var neighborStatus = RoadManager.GetRoadNeighborStatus(gridPosition, grid, structuresToBeModified); RoadStructureHelper roadToReturn = null; roadToReturn = RoadManager.CheckIfStraightRoadFits(neighborStatus, roadToReturn, structureDat); if (roadToReturn != null) return roadToReturn; roadToReturn = RoadManager.CheckIfCornerRoadFits(neighborStatus, roadToReturn, structureDat); if (roadToReturn != null) return roadToReturn; roadToReturn = RoadManager.CheckIfThreewayRoadFits(neighborStatus, roadToReturn, structureDat); if (roadToReturn != null) return roadToReturn; roadToReturn = RoadManager.CheckIfFourwayRoadFits(neighborStatus, roadToReturn, structureDat); if (roadToReturn != null) return roadToReturn; return roadToReturn; }