blob: 699b9c4fb1f93b21adb6e600323e25b195297219 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#include <kurator/battles/Battle.h>
#include <kurator/battles/components.h>
#include <kurator/battles/Scenario.h>
#include <kurator/universe/ShipType.h>
namespace kurator
{
namespace battles
{
Battle::Battle(Scenario scenario)
{
int team = 0;
for (const auto& ships : scenario.teams) {
for (const auto& ship : ships) {
const auto entity = registry.create();
registry.emplace<universe::ShipType>(entity, ship.type);
registry.emplace<Team>(entity, team);
}
team++;
}
}
} // namespace battles
} // namespace kurator
|