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
30
31
32
33
34
35
36
37
38
39
40
41
|
#include <kurator/campaign/scenarios.h>
#include <kurator/campaign/Loadout.h>
#include <kurator/campaign/Scenario.h>
#include <kurator/campaign/ShipConfig.h>
#include <kurator/universe.h>
namespace kurator
{
namespace campaign
{
namespace scenarios
{
Scenario
example(int teams, int anvils, int warbringers, int eclipses, double distance)
{
int id = 0;
const auto repo = universe::load_json("resources/universe");
const auto charge_laser = repo->turret_type("ChargeLaser");
const Loadout anvil{repo->ship_type("Anvil"), {charge_laser, repo->turret_type("GaussCannon")}};
const Loadout eclipse{repo->ship_type("Eclipse"), {charge_laser}};
const Loadout warbringer{repo->ship_type("Warbringer"), {repo->turret_type("BurstLaser")}};
Scenario scenario {"Example", distance, {}};
for (int team = 0; team < teams; ++team) {
for (int i = 0; i < anvils; ++i)
scenario.ships.push_back(ShipConfig{{id++}, team, anvil});
for (int i = 0; i < warbringers; ++i)
scenario.ships.push_back(ShipConfig{{id++}, team, warbringer});
for (int i = 0; i < eclipses; ++i)
scenario.ships.push_back(ShipConfig{{id++}, team, eclipse});
}
return scenario;
}
} // namespace scenarios
} // namespace campaign
} // namespace kurator
|