clear main

This commit is contained in:
s450026 2020-06-09 17:27:51 +02:00
parent 6790341472
commit d46137d634

23
main.py
View File

@ -30,7 +30,6 @@ if __name__ == "__main__":
path = ''
# Dominik
check = 0
queue = []
fromBar = 0
barNode = (3, 12)
@ -70,21 +69,13 @@ if __name__ == "__main__":
guest = newGuests[len(newGuests) - 1]
goal = [0, 0]
# if guest.cord[0] == 2 or guest.cord[1] == 9:
# goal[0] = guest.cord[0] - 1
# goal[1] = guest.cord[1]
#
# else:
# goal[0] = guest.cord[0] + 1
# goal[1] = guest.cord[1]
goal[0] = guest.cord[0]
goal[1] = guest.cord[1]
tree.TasksList('order', goal, [waiter.X, waiter.Y])
tree.print()
check = 1
print(actions)
return tree.ReturnQueueList()
@ -116,7 +107,6 @@ if __name__ == "__main__":
tree.TasksList('eat', [1, 1], waitPosition)
queue = tree.ReturnQueueList()
tree.print()
check = 1
if event.key == pygame.K_m:
if (not [waiter.X, waiter.Y] in waitPos) or go == 0:
@ -211,7 +201,6 @@ if __name__ == "__main__":
# Dominik
if queue and path == '' and fromBar == 0:
print('dsads{}'.format(queue))
task = queue.pop(0)
tree.RemoveTask()
node = (task[2][0], task[2][1])
@ -221,22 +210,12 @@ if __name__ == "__main__":
else:
path = waiter.findPath(node)
path = waiter.translatePath(path)
if fromBar == 1:
check = 0
if path == '' and fromBar == 1:
path = waiter.findPath(node)
path = waiter.translatePath(path)
fromBar = 0
if path != '':
nextStep = path[0]
path = path[1:]
waiter.travel(nextStep, graphics)
if queue and len(queue) != 0 and check == 0 and path == '' and fromBar == 0:
check = 1
# AStar
if path == '' and actions:
print('Goal: {}'.format(actions[0][1]))