Browse Source

tank global move coef in config

Bastien Sevajol 6 years ago
parent
commit
eb74c53f4b
2 changed files with 13 additions and 1 deletions
  1. 3 0
      config.yaml
  2. 10 1
      opencombat/simulation/subject.py

+ 3 - 0
config.yaml View File

@@ -12,6 +12,9 @@ game:
12 12
         walk_ref_time: 3
13 13
         run_ref_time: 1
14 14
         crawl_ref_time: 10
15
+        subject:
16
+          tank1:
17
+            global_move_coeff: 3
15 18
     building:
16 19
       draw_interior_gap: 2
17 20
 

+ 10 - 1
opencombat/simulation/subject.py View File

@@ -60,6 +60,15 @@ class ManSubject(TileSubject):
60 60
     pass
61 61
 
62 62
 class TankSubject(TileSubject):
63
+    def __init__(self, *args, **kwargs) -> None:
64
+        super().__init__(*args, **kwargs)
65
+        # TODO BS 2018-01-26: This coeff will be dependent of real
66
+        # unit type (tiger 2, etc)
67
+        self._global_move_coeff = self.config.resolve(
68
+            'game.move.subject.tank1.global_move_coeff',
69
+            3,
70
+        )
71
+
63 72
     @property
64 73
     def global_move_coeff(self) -> float:
65
-        return 3
74
+        return self._global_move_coeff