Abstract interface for game states.
More...
#include <IState.hpp>
|
|
| IState (void) |
| | Default constructor; initializes class variables to zero.
|
|
virtual | ~IState (void) |
| | Destructor; declared virtual for inheritance.
|
| | IState (uint32 id) |
| | Constructor for user-defined initialization of the class variable fields.
|
| | IState (uint32 id, uint32 flags, IState::Type type) |
| | Constructor for user-defined initialization of the class variable fields.
|
| uint32 | id (void) const |
| | Obtain the user-defined identifier of the state.
|
| uint32 | timestamp (void) const |
| | Obtain the recorded time stamp of the state.
|
| uint32 | flags (void) const |
| | Obtain the user-defined flags of the state.
|
| IState::Type | type (void) const |
| | Get the type of state.
|
| virtual bool | on_event (const nom::Event &ev) |
| | User-defined implementation of the state's event handling logic.
|
| virtual void | on_update (float) |
| | User-defined implementation of the state's update logic.
|
| virtual void | on_draw (RenderWindow &) |
| virtual void | on_init (void_ptr) |
| | User-defined implementation of the state's initialization logic.
|
| virtual void | on_exit (void_ptr) |
| | User-defined implementation of the state's destruction logic.
|
| virtual void | on_pause (void_ptr) |
| | User-defined implementation of the state's paused state logic.
|
| virtual void | on_resume (void_ptr) |
| | User-defined implementation of the state's resume from pause state logic.
|
|
| uint32 | id_ |
| | Unique identifier for the state.
|
| uint32 | timestamp_ |
| | Number of ticks recorded at the time of state's construction.
|
| uint32 | flags_ |
| | Specialized state management.
|
| Type | type_ |
| | The type of state.
|
Abstract interface for game states.
Definition at line 43 of file IState.hpp.
◆ unique_ptr
| typedef std::unique_ptr<IState> nom::IState::unique_ptr |
◆ Flags
Specialized control over state management.
| Enumerator |
|---|
| BackUpdate | Request to nom::StateMachine to let previous state continue updating itself.
|
| BackRender | Request to nom::StateMachine to let previous state continue rendering itself.
|
Definition at line 51 of file IState.hpp.
◆ Type
State type enumeration.
| Enumerator |
|---|
| Parent | Top-level / top-most placement on the stack.
|
Definition at line 65 of file IState.hpp.
◆ IState() [1/2]
| nom::IState::IState |
( |
uint32 | id | ) |
|
Constructor for user-defined initialization of the class variable fields.
- Parameters
-
| id | Unique identifier of the state |
◆ IState() [2/2]
| nom::IState::IState |
( |
uint32 | id, |
|
|
uint32 | flags, |
|
|
IState::Type | type ) |
Constructor for user-defined initialization of the class variable fields.
- Parameters
-
| id | Unique identifier of the state |
| flags | One or more of the nom::IState::StateFlags enumerations. |
| type | The type of state; one of the IState::Type enumeration values. |
◆ flags()
| uint32 nom::IState::flags |
( |
void | | ) |
const |
Obtain the user-defined flags of the state.
- Returns
- Bit masked enumeration of nom::IState::StateFlags.
◆ id()
| uint32 nom::IState::id |
( |
void | | ) |
const |
Obtain the user-defined identifier of the state.
- Returns
- ID of the state
◆ on_draw()
User-defined implementation of the state's rendering logic
- Parameters
-
- Todo
- Consider removing RenderTarget argument; I think we can get away with this.
◆ on_event()
| virtual bool nom::IState::on_event |
( |
const nom::Event & | ev | ) |
|
|
virtual |
User-defined implementation of the state's event handling logic.
- Parameters
-
- Returns
- This method should return Boolean TRUE when the nom::Event object has been processed (think: consumed) by the user-implemented method, and boolean FALSE when the nom::Event object has not been processed (think: consumed). The default implementation returns false.
- See also
- StateMachine::on_event
◆ on_exit()
| virtual void nom::IState::on_exit |
( |
void_ptr | | ) |
|
|
virtual |
User-defined implementation of the state's destruction logic.
- Parameters
-
| void_ptr | A void pointer to user-defined data |
◆ on_init()
| virtual void nom::IState::on_init |
( |
void_ptr | | ) |
|
|
virtual |
User-defined implementation of the state's initialization logic.
- Parameters
-
| void_ptr | A void pointer to user-defined data |
◆ on_pause()
| virtual void nom::IState::on_pause |
( |
void_ptr | | ) |
|
|
virtual |
User-defined implementation of the state's paused state logic.
- Parameters
-
| void_ptr | A void pointer to user-defined data |
◆ on_resume()
| virtual void nom::IState::on_resume |
( |
void_ptr | | ) |
|
|
virtual |
User-defined implementation of the state's resume from pause state logic.
- Parameters
-
| void_ptr | A void pointer to user-defined data |
◆ on_update()
| virtual void nom::IState::on_update |
( |
float | | ) |
|
|
virtual |
User-defined implementation of the state's update logic.
- Parameters
-
| float | User-defined; typically a delta time (change in time). |
◆ timestamp()
| uint32 nom::IState::timestamp |
( |
void | | ) |
const |
Obtain the recorded time stamp of the state.
- Returns
- Number of ticks recorded at the time of construction
◆ type()
Get the type of state.
- Returns
- One of the IState::Type enumeration values.
◆ flags_
| uint32 nom::IState::flags_ |
|
private |
Specialized state management.
Definition at line 185 of file IState.hpp.
◆ id_
Unique identifier for the state.
Definition at line 179 of file IState.hpp.
◆ timestamp_
| uint32 nom::IState::timestamp_ |
|
private |
Number of ticks recorded at the time of state's construction.
Definition at line 182 of file IState.hpp.
◆ type_
The documentation for this class was generated from the following file:
- /home/jeff/Projects/nomlib.git/include/nomlib/system/IState.hpp