helpers.py 990 B

1234567891011121314151617181920212223242526272829
  1. def canRiotAPC(queue):
  2. t_q = [i['type'] for i in queue]
  3. return t_q.count('Wheel') >= 4 and t_q.count('Body') >= 1 and t_q.count('WaterCannon') >= 1
  4. def isRiotAPC(queue):
  5. if canRiotAPC(queue):
  6. toremove = ['Wheel','Wheel','Wheel','Wheel','Body','WaterCannon']
  7. while toremove:
  8. tofind = toremove.pop()
  9. for idx, it in enumerate(queue):
  10. if (it['type'] == tofind):
  11. break
  12. del queue[idx]
  13. return True
  14. def canWarAPC(queue):
  15. t_q = [i['type'] for i in queue]
  16. return t_q.count('Tracks') >= 2 and t_q.count('Body') >= 1 and t_q.count('MachineGun') >= 1
  17. def isWarAPC(queue):
  18. if canWarAPC(queue):
  19. toremove = ['Tracks','Tracks','Body','MachineGun']
  20. while toremove:
  21. tofind = toremove.pop()
  22. for idx, it in enumerate(queue):
  23. if (it['type'] == tofind):
  24. break
  25. del queue[idx]
  26. return True