BossFightUI now gets everything from a world and will be implemented like the rest of the game, but as a mini game.
This commit is contained in:
parent
ca18422930
commit
6e8aa48332
4 changed files with 34 additions and 25 deletions
|
@ -21,12 +21,9 @@ LevelScaling LevelManager::scale_level() {
|
|||
};
|
||||
}
|
||||
|
||||
shared_ptr<gui::BossFightUI> LevelManager::create_bossfight(shared_ptr<DinkyECS::World> prev_world) {
|
||||
dbc::check(prev_world != nullptr, "Starter world for boss fights can't be null.");
|
||||
return make_shared<gui::BossFightUI>(*prev_world, "RAT_KING");
|
||||
}
|
||||
|
||||
size_t LevelManager::create_level(shared_ptr<DinkyECS::World> prev_world) {
|
||||
inline shared_ptr<DinkyECS::World> clone_load_world(shared_ptr<DinkyECS::World> prev_world)
|
||||
{
|
||||
auto world = make_shared<DinkyECS::World>();
|
||||
|
||||
if(prev_world != nullptr) {
|
||||
|
@ -35,6 +32,22 @@ size_t LevelManager::create_level(shared_ptr<DinkyECS::World> prev_world) {
|
|||
save::load_configs(*world);
|
||||
}
|
||||
|
||||
return world;
|
||||
}
|
||||
|
||||
shared_ptr<gui::BossFightUI> LevelManager::create_bossfight(shared_ptr<DinkyECS::World> prev_world) {
|
||||
dbc::check(prev_world != nullptr, "Starter world for boss fights can't be null.");
|
||||
auto world = clone_load_world(prev_world);
|
||||
auto& config = prev_world->get_the<GameConfig>();
|
||||
auto& boss_data = config.bosses["RAT_KING"];
|
||||
auto boss_id = world->entity();
|
||||
components::configure_entity($components, *world, boss_id, boss_data["components"]);
|
||||
|
||||
return make_shared<gui::BossFightUI>(world, boss_id);
|
||||
}
|
||||
|
||||
size_t LevelManager::create_level(shared_ptr<DinkyECS::World> prev_world) {
|
||||
auto world = clone_load_world(prev_world);
|
||||
auto scaling = scale_level();
|
||||
|
||||
auto map = make_shared<Map>(scaling.map_width, scaling.map_height);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue