fire.py 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # coding: utf-8
  2. import typing
  3. from synergine2.config import Config
  4. from synergine2.simulation import SimulationBehaviour
  5. from synergine2.simulation import Simulation
  6. from synergine2.simulation import Event
  7. from synergine2.simulation import Intention
  8. from synergine2_xyz.simulation import XYZSimulation
  9. class FireIntention(Intention):
  10. def __init__(
  11. self,
  12. to_position: typing.Tuple[int, int],
  13. to_subject_id: int,
  14. gui_action: typing.Any,
  15. ) -> None:
  16. self.to_position = to_position
  17. self.to_subject_id = to_subject_id
  18. self.gui_action = gui_action
  19. class RequestFireBehaviour(SimulationBehaviour):
  20. move_intention_class = FireIntention
  21. def __init__(
  22. self,
  23. config: Config,
  24. simulation: Simulation,
  25. ):
  26. super().__init__(config, simulation)
  27. self.simulation = typing.cast(XYZSimulation, self.simulation)
  28. def action(self, data) -> typing.List[Event]:
  29. to_position = data['to_position']
  30. to_subject_id = data['to_subject_id']
  31. return []