ColonyConfiguration   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get_start_position() 0 3 1
A get_start_objects() 0 10 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