Total Complexity | 5 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | from intelligine.simulation.object.brain.part.move.AntStar.HostFeeler import HostFeeler |
||
6 | class Host: |
||
7 | |||
8 | def __init__(self, context, object_id): |
||
9 | self._context = context |
||
10 | self._object_id = object_id |
||
11 | self._feeler = HostFeeler(context, object_id) |
||
12 | self._moved_to_direction = None |
||
13 | self._position_3d = self._context.metas.value.get(POSITION, self._object_id) |
||
14 | |||
15 | def get_position(self): |
||
16 | return self._position_3d[1], self._position_3d[2] |
||
17 | |||
18 | def get_feeler(self): |
||
19 | return self._feeler |
||
20 | |||
21 | def move_to(self, direction): |
||
22 | self._moved_to_direction = direction |
||
23 | self._position_3d = get_position_with_direction_decal(direction, self._position_3d) |
||
24 | |||
25 | def get_moved_to_direction(self): |
||
26 | return self._moved_to_direction |
||
27 |