ColonyConfiguration.get_start_objects()   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 2
1
from synergine.synergy.collection.Configuration import Configuration
2
from intelligine.synergy.object.ant.Ant import Ant
3
from synergine_xyz.cst import POSITION
4
5
6
class ColonyConfiguration(Configuration):
7
8
    _start_position = (0, 20, 20)
9
    _ant_class = Ant
10
    _ant_count = 50
11
12
    @classmethod
13
    def get_start_position(cls):
14
        return cls._start_position
15
16
    def get_start_objects(self, collection, context):
17
      context.metas.value.set(POSITION, collection.get_id(), self._start_position)
18
19
      ants = []
20
      for i in range(self._ant_count):
21
          ant = self._ant_class(collection, context)
22
          ant.set_position(self._start_position)
23
          ants.append(ant)
24
25
      return ants