physics.py 693B

1234567891011121314151617181920212223242526272829
  1. # coding: utf-8
  2. from synergine2_xyz.map import XYZTile
  3. from synergine2_xyz.physics import MoveCostComputer
  4. if False:
  5. from sandbox.tile.simulation.base import BaseSubject
  6. class TerrainTile(XYZTile):
  7. pass
  8. class TileMoveCostComputer(MoveCostComputer):
  9. def compute_move_cost(
  10. self,
  11. subject: 'BaseSubject',
  12. tile: TerrainTile,
  13. previous_node: str,
  14. next_node: str,
  15. unknown,
  16. ) -> float:
  17. # TODO: Objets/IT qui compute les couts de déplacement
  18. if not tile.property('traversable_by_man'):
  19. # TODO: revoir la lib disjkstar because les mecs traverses quand meme ...
  20. return 100
  21. return 1.0