|
@@ -11,6 +11,7 @@ from synergine2.core import Core
|
11
|
11
|
from synergine2.cycle import CycleManager
|
12
|
12
|
from synergine2.terminals import TerminalManager
|
13
|
13
|
|
|
14
|
+from opencombat.ai.placement import Placement
|
14
|
15
|
from opencombat.simulation.base import TileStrategySimulation
|
15
|
16
|
from opencombat.simulation.base import TileStrategySubjects
|
16
|
17
|
from opencombat.state import StateConstructorBuilder
|
|
@@ -48,6 +49,7 @@ def main(
|
48
|
49
|
|
49
|
50
|
simulation = TileStrategySimulation(config, map_file_path=map_file_path)
|
50
|
51
|
subjects = TileStrategySubjects(simulation=simulation)
|
|
52
|
+ simulation.subjects = subjects
|
51
|
53
|
|
52
|
54
|
if state_file_path:
|
53
|
55
|
state_loader_builder = StateConstructorBuilder(config, simulation)
|
|
@@ -58,10 +60,11 @@ def main(
|
58
|
60
|
elif troops_file_path:
|
59
|
61
|
troop_loader_builder = TroopConstructorBuilder(config, simulation)
|
60
|
62
|
troop_loader = troop_loader_builder.get_troop_loader()
|
|
63
|
+ placement = Placement(config, simulation)
|
|
64
|
+
|
61
|
65
|
troops = troop_loader.get_troop(troops_file_path)
|
62
|
66
|
subjects.extend(troops.subjects)
|
63
|
|
-
|
64
|
|
- simulation.subjects = subjects
|
|
67
|
+ placement.place()
|
65
|
68
|
|
66
|
69
|
core = Core(
|
67
|
70
|
config=config,
|
|
@@ -114,6 +117,15 @@ if __name__ == '__main__':
|
114
|
117
|
)
|
115
|
118
|
exit(1)
|
116
|
119
|
|
|
120
|
+ if args.troops and not args.placement:
|
|
121
|
+ print(
|
|
122
|
+ 'Cannot load troops "{}" without activate placement mode.'.format(
|
|
123
|
+ args.state,
|
|
124
|
+ ),
|
|
125
|
+ file=sys.stderr,
|
|
126
|
+ )
|
|
127
|
+ exit(1)
|
|
128
|
+
|
117
|
129
|
main(
|
118
|
130
|
args.map_dir_path,
|
119
|
131
|
seed_value=args.seed,
|