Host.py 731B

12345678910111213141516171819202122232425
  1. from intelligine.simulation.object.brain.part.move.AntStar.HostFeeler import HostFeeler
  2. from synergine_xyz.cst import POSITION
  3. class Host:
  4. def __init__(self, context, object_id):
  5. self._context = context
  6. self._object_id = object_id
  7. self._feeler = HostFeeler(context, object_id)
  8. self._moved_to_direction = None
  9. def get_position(self):
  10. current_position = self._context.metas.value.get(POSITION, self._object_id)
  11. return current_position[1], current_position[2]
  12. def get_feeler(self):
  13. return self._feeler
  14. def move_to(self, direction):
  15. self._moved_to_direction = direction
  16. def get_moved_to_direction(self):
  17. return self._moved_to_direction