Started working on mode handling

This commit is contained in:
d3rped 2018-03-24 14:32:48 +01:00
parent 29849c2dd1
commit 3112046256
3 changed files with 16 additions and 20 deletions

View file

@ -23,30 +23,18 @@ def run():
while(communication.planetname is None):
communication.process_messages()
print("received Planet Name")
while(communication.status() is not Mode.COMPLETE):
while(communication.status() is Mode.GOTOSTATION): # should be triggered if current station has no unexplored edges
while(communication.status() is Mode.GOTOSTATION or communication.status() is Mode.TARGET): # should be triggered if current station has no unexplored edges
for instructions in communication.navto:
for instructions in communication.navto:
communication.update(None)
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:
for instructions in communication.navto:
move.turnto(instructions[1])
move.traversetonextstation(True)
communication.update()
communication(move.getstationedges()) # TODO: Register in map
communication.update(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()
if(communication.check(move.traversetonextstation(False)) is False): # TODO: let same control mechanism decide if station is known, also traversetonextstation needs a return value
move.setcurdir(communication.getdir())
# DO NOT EDIT