Rearranged and simplified main loop.

This commit is contained in:
d3rped 2018-03-24 06:32:25 +01:00
parent c1049f4a58
commit 29849c2dd1

View file

@ -26,21 +26,23 @@ def run():
print("received Planet Name")
while(communication.status() is not Mode.COMPLETE):
move.getstationedges() # TODO: Register in map
move.turnto(90) # TODO: add control mechanism to communication class
move.traversetonextstation(False) # TODO: let same control mechanism decide if station is known, also traversetonextstation needs a return value
while(communication.status() is Mode.GOTOSTATION): # should be triggered if current station has no unexplored edges
for instructions in communication.navto:
move.follow(instructions)
for instructions in communication.navto:
move.turnto(instructions[1])
move.traversetonextstation(True)
communication.update()
while(communication.status() is Mode.TARGET): # should be triggered when communication gets TARGET signal from server
for instructions in communication.navto:
move.follow(instructions)
communication.update() # TODO: implement update function that communicates with server and waits/checks for new instructions
if(communication.status() == Mode.TARGET2): # TODO: implement Target change
break
for instructions in communication.navto:
move.turnto(instructions[1])
move.traversetonextstation(True)
communication.update()
communication(move.getstationedges()) # TODO: Register in map
move.turnto(communication.navto[0][1]) # TODO: add control mechanism to communication class
move.traversetonextstation(False) # TODO: let same control mechanism decide if station is known, also traversetonextstation needs a return value
communication.update()