def _placeTileSources(self, mlat, mlng):
# Check if this tile was already processed
- alr_processed = self._checkVisited(self._already_visited, (self._tile_v, self._tile_h))
+ alr_processed = self._checkAlrVisited((self._tile_v, self._tile_h))
# If this is not the case, we can proceed
if alr_processed == False:
for l in range(len(vst)):
if self._checkVisited(visited, (vst[l][0], vst[l][1])) == False: visited.append((vst[l][0], vst[l][1]))
+ # Store this in the object array so orthographic can access the data
self._all_visited = visited
-
- # We will take the resource of the original tile we have started
- # our scan from. If there is nothing, we can choose.
- # This is then used for all visited tiles.
+
+ # Set coordinates
tv = self._tile_v
th = self._tile_h
+ # Pick a resource combination
resstring = self._selectResources()
+ # Store this for all encountered tiles
for v in range(0, len(visited)):
- self._storeResourceInfo(visited[v][0], visited[v][1], resstring)
+ rs = self._getResourceInfo(visited[v][0], visited[v][1])
+ if rs == "0": self._storeResourceInfo(visited[v][0], visited[v][1], resstring)
# Check if a tile was visited
break
return v
+
+ # Check if a tile was visited
+ def _checkAlrVisited(self, tile):
+ v = False
+ for t in range(1, len(self._already_visited)):
+ if self._already_visited[t][0] == tile[0] and self._already_visited[t][1] == tile[1]:
+ v = True
+ break
+ return v
+
# Show result of path tracing - DEBUG ONLY
def _debugRender(self, visited, mlat, mlng):