Peoplemon  0.1.0
Peoplemon 3 game source documentation
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
game::state::BagMenu Class Reference

State for displaying the player's inventory and selecting items. More...

#include <BagMenu.hpp>

+ Inheritance diagram for game::state::BagMenu:

Public Types

using Context = core::event::OpenBagMenu::Context
 Represents how the menu was opened and affects how it may be used. More...
 

Public Member Functions

virtual ~BagMenu ()=default
 Destroy the Bag Menu object. More...
 
virtual const char * name () const override
 Returns "BagMenu". More...
 
virtual void activate (bl::engine::Engine &) override
 Populates the menu with the player's inventory. More...
 
virtual void deactivate (bl::engine::Engine &) override
 Unsubscribes from event and input buses. More...
 
virtual void update (bl::engine::Engine &, float dt, float) override
 Updates the menu. More...
 

Static Public Member Functions

static bl::engine::State::Ptr create (core::system::Systems &systems, Context ctx, core::item::Id *result=nullptr, int outNow=-1, int *chosenPeoplemon=nullptr, bool *unpause=nullptr)
 Creates a new BagMenu. More...
 

Protected Attributes

core::system::Systemssystems
 

Detailed Description

State for displaying the player's inventory and selecting items.

Definition at line 22 of file BagMenu.hpp.

Member Typedef Documentation

◆ Context

Represents how the menu was opened and affects how it may be used.

Definition at line 27 of file BagMenu.hpp.

Constructor & Destructor Documentation

◆ ~BagMenu()

virtual game::state::BagMenu::~BagMenu ( )
virtualdefault

Destroy the Bag Menu object.

Member Function Documentation

◆ activate()

void game::state::BagMenu::activate ( bl::engine::Engine &  engine)
overridevirtual

Populates the menu with the player's inventory.

Implements game::state::State.

Definition at line 172 of file BagMenu.cpp.

◆ create()

bl::engine::State::Ptr game::state::BagMenu::create ( core::system::Systems systems,
Context  ctx,
core::item::Id result = nullptr,
int  outNow = -1,
int *  chosenPeoplemon = nullptr,
bool *  unpause = nullptr 
)
static

Creates a new BagMenu.

Parameters
systemsThe main game systems
ctxContext the bag is being used from
resultOptional item to populate with the chosen item
outNowIndex of the currently out Peoplemon if in battle
unpausePointer to boolean to set if pause menu should close after bag closes
Returns
bl::engine::State::Ptr

Definition at line 73 of file BagMenu.cpp.

◆ deactivate()

void game::state::BagMenu::deactivate ( bl::engine::Engine &  engine)
overridevirtual

Unsubscribes from event and input buses.

Implements game::state::State.

Definition at line 242 of file BagMenu.cpp.

◆ name()

const char * game::state::BagMenu::name ( ) const
overridevirtual

Returns "BagMenu".

Implements game::state::State.

Definition at line 170 of file BagMenu.cpp.

◆ update()

void game::state::BagMenu::update ( bl::engine::Engine &  engine,
float  dt,
float   
)
overridevirtual

Updates the menu.

Parameters
dtTime elapsed in seconds since the last call to update

Implements game::state::State.

Definition at line 247 of file BagMenu.cpp.

Member Data Documentation

◆ systems

core::system::Systems& game::state::State::systems
protectedinherited

Definition at line 66 of file State.hpp.


The documentation for this class was generated from the following files: