Rename to GameDB and GameDB::Level.
This commit is contained in:
parent
c46927ea10
commit
a20d701096
23 changed files with 142 additions and 151 deletions
16
gui/fsm.cpp
16
gui/fsm.cpp
|
@ -53,7 +53,7 @@ namespace gui {
|
|||
$combat_ui.init();
|
||||
$status_ui.init();
|
||||
|
||||
$boss_fight_ui = Game::create_bossfight();
|
||||
$boss_fight_ui = GameDB::create_bossfight();
|
||||
$boss_fight_ui->init();
|
||||
|
||||
$map_ui.init();
|
||||
|
@ -96,7 +96,7 @@ namespace gui {
|
|||
|
||||
void FSM::ROTATING(Event) {
|
||||
if(auto aim = $main_ui.play_rotate()) {
|
||||
auto& player_pos = Game::player_position();
|
||||
auto& player_pos = GameDB::player_position();
|
||||
player_pos.aiming_at = *aim;
|
||||
state(State::IDLE);
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ namespace gui {
|
|||
|
||||
void FSM::COMBAT_ROTATE(Event) {
|
||||
if(auto aim = $main_ui.play_rotate()) {
|
||||
auto& player_pos = Game::player_position();
|
||||
auto& player_pos = GameDB::player_position();
|
||||
player_pos.aiming_at = *aim;
|
||||
state(State::IN_COMBAT);
|
||||
}
|
||||
|
@ -267,7 +267,7 @@ namespace gui {
|
|||
}
|
||||
|
||||
void FSM::try_move(int dir, bool strafe) {
|
||||
auto& level = Game::current();
|
||||
auto& level = GameDB::current();
|
||||
using enum State;
|
||||
// prevent moving into occupied space
|
||||
Point move_to = $main_ui.plan_move(dir, strafe);
|
||||
|
@ -356,7 +356,7 @@ namespace gui {
|
|||
event(Event::LOOT_OPEN);
|
||||
break;
|
||||
case KEY::Z: {
|
||||
auto& player_pos = Game::player_position();
|
||||
auto& player_pos = GameDB::player_position();
|
||||
System::distribute_loot({player_pos.aiming_at});
|
||||
} break;
|
||||
case KEY::X:
|
||||
|
@ -430,7 +430,7 @@ namespace gui {
|
|||
|
||||
void FSM::handle_world_events() {
|
||||
using eGUI = Events::GUI;
|
||||
auto world = Game::current_world();
|
||||
auto world = GameDB::current_world();
|
||||
|
||||
while(world->has_event<eGUI>()) {
|
||||
auto [evt, entity, data] = world->recv<eGUI>();
|
||||
|
@ -540,14 +540,14 @@ namespace gui {
|
|||
|
||||
void FSM::next_level() {
|
||||
dbc::log("current_level: Yep, next is called...");
|
||||
Game::create_level();
|
||||
GameDB::create_level();
|
||||
|
||||
$status_ui.update_level();
|
||||
$combat_ui.update_level();
|
||||
$main_ui.update_level();
|
||||
$loot_ui.update_level();
|
||||
|
||||
$boss_fight_ui = Game::create_bossfight();
|
||||
$boss_fight_ui = GameDB::create_bossfight();
|
||||
$boss_fight_ui->init();
|
||||
|
||||
run_systems();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue