12 return bl::engine::State::Ptr(
new SaveGame(s));
16 :
State(s,
bl::engine::StateMask::Menu) {
17 bgndTxtr = s.
engine().renderer().texturePool().getOrLoadTexture(
19 background.create(s.
engine(), bgndTxtr);
20 background.getTransform().setDepth(bl::cam::OverlayCamera::MaxDepth);
26 background.addToScene(engine.renderer().getObserver().pushScene<bl::rc::Overlay>(),
27 bl::rc::UpdateSpeed::Static);
29 const auto cb = std::bind(&SaveGame::onFinish,
this);
37 engine.renderer().getObserver().popScene();
Parent namespace for all functionality unique to the game.
static bool saveGame(const std::string &name)
Saves the game. Fires an event::GameSaveInitializing event for systems to add their data to the save ...
static const std::string & MenuImagePath()
void displayMessage(const std::string &message, const Callback &cb=[](const std::string &) {})
Displays a message in the HUD textbox. Messages are queued in order that they arrive.
player::State & state()
Returns the state of the player.
Owns all primary systems and a reference to the engine.
const bl::engine::Engine & engine() const
Const accessor for the Engine.
Player & player()
Returns the player system.
HUD & hud()
Returns the HUD.
Basic engine state for when the game is saved.
virtual void activate(bl::engine::Engine &engine) override
Activates the state.
virtual const char * name() const override
Returns "SaveGame".
virtual void update(bl::engine::Engine &engine, float dt, float) override
Updates the state and menus and whatnot.
static bl::engine::State::Ptr create(core::system::Systems &systems)
Creates the save game state.
virtual void deactivate(bl::engine::Engine &engine) override
Deactivates the state.
Parent to all game states. Provides some commonly required data like core game systems.
core::system::Systems & systems