event.py 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # coding: utf-8
  2. # TODO: Reprendre les events Move, pour les lister tous ici
  3. import typing
  4. from synergine2.simulation import Event
  5. class NewVisibleOpponent(Event):
  6. def __init__(
  7. self,
  8. observer_subject_id: int,
  9. observed_subject_id: int,
  10. ) -> None:
  11. self.observer_subject_id = observer_subject_id
  12. self.observed_subject_id = observed_subject_id
  13. class NoLongerVisibleOpponent(Event):
  14. def __init__(
  15. self,
  16. observer_subject_id: int,
  17. observed_subject_id: int,
  18. ) -> None:
  19. self.observer_subject_id = observer_subject_id
  20. self.observed_subject_id = observed_subject_id
  21. class FireEvent(Event):
  22. def __init__(
  23. self,
  24. shooter_subject_id: int,
  25. target_position: typing.Tuple[int, int],
  26. ) -> None:
  27. self.shooter_subject_id = shooter_subject_id
  28. self.target_position = target_position
  29. class DieEvent(Event):
  30. def __init__(
  31. self,
  32. shooter_subject_id: int,
  33. shoot_subject_id: int,
  34. ) -> None:
  35. self.shooter_subject_id = shooter_subject_id
  36. self.shoot_subject_id = shoot_subject_id