Host.get_moved_to_direction()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 2
rs 10
cc 1
1
from intelligine.simulation.object.brain.part.move.AntStar.HostFeeler import HostFeeler
2
from intelligine.synergy.event.move.direction import get_position_with_direction_decal
3
from synergine_xyz.cst import POSITION
4
5
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