|
|
@ -131,6 +131,7 @@ public class MapManager : ScriptableObject |
|
|
|
|
|
|
|
void chooseNextSection() |
|
|
|
{ |
|
|
|
Debug.Log("<b>Choosing next section </b>"); |
|
|
|
//First, we determine which sections are valid
|
|
|
|
List<MapSection> validSections = new List<MapSection>(); |
|
|
|
|
|
|
@ -146,6 +147,8 @@ public class MapManager : ScriptableObject |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
Debug.Log("Checking section " + section.name + ", weight = " + section.weight); |
|
|
|
|
|
|
|
if (section.weight > 0 && checkSegments(section)) |
|
|
|
{ |
|
|
|
//If a segment is a valid continuation of the current most-recent segment, add it to the list
|
|
|
@ -189,6 +192,7 @@ public class MapManager : ScriptableObject |
|
|
|
|
|
|
|
bool checkSegments(MapSection first, MapSection second) |
|
|
|
{ |
|
|
|
Debug.Log("Checking " + first.name + " & " + second.name); |
|
|
|
int connections = 0; |
|
|
|
//No more than one link section in a row
|
|
|
|
if (first.length == 1 && second.length == 1) |
|
|
@ -216,6 +220,9 @@ public class MapManager : ScriptableObject |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Debug.Log("Check result: " + (connections >= minConns)); |
|
|
|
|
|
|
|
return (connections >= minConns); |
|
|
|
} |
|
|
|
|
|
|
@ -361,6 +368,8 @@ public class MapManager : ScriptableObject |
|
|
|
{ |
|
|
|
widthMax = widthMaxMin; |
|
|
|
} |
|
|
|
|
|
|
|
Debug.Log("Difficulty = " + difficulty + ", widthMin = " + widthMin + ", widthMax = " + widthMax); |
|
|
|
} |
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|