public void RoadManagerTestsCheckIfNeighbourIsRoadInDictionaryCheckIfThreeWayFitsR270() { var result = RoadManager.CheckIf3WayFits((int)Direction.Up | (int)Direction.Left | (int)Direction.Right, null, roadSO); Assert.AreEqual(road3Way, result.RoadPrefab); Assert.AreEqual(RotationValue.R270, result.RoadPrefabRotation); }
public static RoadStructureHelper GetCorrectRoadPrefab(Vector3 gridPosition, StructureBaseSO structureData, Dictionary <Vector3Int, GameObject> structuresToBeModified, GridStructure grid) { var neighboursStatus = RoadManager.GetRoadNeighboursStatus(gridPosition, grid, structuresToBeModified); RoadStructureHelper roadToReturn = null; roadToReturn = RoadManager.CheckIfStraightRoadFits(neighboursStatus, roadToReturn, structureData); if (roadToReturn != null) { return(roadToReturn); } roadToReturn = RoadManager.CheckIfCornerFits(neighboursStatus, roadToReturn, structureData); if (roadToReturn != null) { return(roadToReturn); } roadToReturn = RoadManager.CheckIf3WayFits(neighboursStatus, roadToReturn, structureData); if (roadToReturn != null) { return(roadToReturn); } roadToReturn = RoadManager.CheckIf4WaysFits(neighboursStatus, roadToReturn, structureData); return(roadToReturn); }