blob: e34109066745eb5a6765932e2a6a58a912df685a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#include <crepe/api/BehaviorScript.h>
#include "ZapperPoolSubScene.h"
#include "ZapperPoolScript.h"
using namespace crepe;
using namespace std;
ZapperPoolSubScene::ZapperPoolSubScene(Scene & scene)
: controller { scene.new_object("controller") } {
Log::logf(Log::DEBUG, "Building zapper pool...");
vector<ZapperObject> pool;
for (size_t i = 0; i < this->POOL_SIZE; i++)
pool.emplace_back(scene.new_object("zapper", "zapper"));
BehaviorScript & behavior = this->controller.add_component<BehaviorScript>();
behavior.set_script<ZapperPoolScript>(std::move(pool));
}
|