exceptions.py 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. from synergine.synergy.event.exception.ActionAborted import ActionException
  2. class MovementException(Exception):
  3. pass
  4. class SamePosition(MovementException):
  5. pass
  6. class UnableToFoundMovement(MovementException):
  7. pass
  8. class PheromoneException(Exception):
  9. pass
  10. class NoPheromone(PheromoneException):
  11. pass
  12. class NoPheromoneMove(PheromoneException, MovementException):
  13. pass
  14. class NoTypeInPheromone(NoPheromone):
  15. pass
  16. class NoCategoryInPheromone(NoPheromone):
  17. pass
  18. class BestPheromoneHere(PheromoneException):
  19. def __init__(self, best_distance, *args, **kwargs):
  20. super().__init__(*args, **kwargs)
  21. self._best_distance = best_distance
  22. def get_best_distance(self):
  23. return self._best_distance
  24. class PheromoneGlandDisabled(PheromoneException):
  25. pass
  26. class BrainException(Exception):
  27. pass
  28. class BrainPartAlreadyExist(BrainException):
  29. pass
  30. class DirectionException(Exception):
  31. pass
  32. class NearException(Exception):
  33. pass
  34. class NearFound(NearException):
  35. pass
  36. class NearNothingFound(NearException):
  37. pass
  38. class CantFindWhereToPut(ActionException):
  39. pass