Represents a scene in a game. More...
#include <Scene.hpp>
Public Member Functions | |
| Scene (const std::string &name) noexcept | |
| Name constructor. | |
| virtual | ~Scene () noexcept |
| Destructor. | |
| void | on_push () override |
| When scene is pushed to the stack. | |
| void | on_pop () override |
| When scene is popped from the stack. | |
| virtual void | on_event (SDL_Event &event) |
| Handle an event for a scene. | |
| virtual void | update (EntityManager &em) |
| Process events and updates. | |
| virtual void | render () |
| Render scene. | |
| SystemManager & | sys_man () noexcept |
| Get system manager. | |
| nlohmann::json | serialize () override |
| Serializes object. | |
| void | deserialize (const nlohmann::json &json) override |
| Deserializes from object. | |
| Public Member Functions inherited from galaxy::State | |
| State (State &&)=default | |
| Move constructor. | |
| State & | operator= (State &&)=default |
| Move assignment operator. | |
| State (const State &)=default | |
| Copy constructor. | |
| State & | operator= (const State &)=default |
| Copy assignment operator. | |
| virtual | ~State ()=default |
| Virtual destructor. | |
| const std::string & | name () const noexcept |
| Get state name. | |
| Public Member Functions inherited from galaxy::Serializable | |
| virtual | ~Serializable () |
| Destructor. | |
| virtual Serializable & | operator= (Serializable &&) noexcept=default |
| Move assignment operator. | |
| virtual Serializable & | operator= (const Serializable &) noexcept=default |
| Copy assignment operator. | |
Private Member Functions | |
| Scene ()=delete | |
| Constructor. | |
| Scene (const Scene &)=delete | |
| Copy constructor. | |
| Scene & | operator= (const Scene &)=delete |
| Copy assignment operator. | |
Private Attributes | |
| SystemManager | m_sysman |
| Systems only used by this scene. | |
| entt::dispatcher | m_dispatcher |
| Scene event handler. | |
Additional Inherited Members | |
| Protected Member Functions inherited from galaxy::State | |
| State (const std::string &name) noexcept | |
| Name constructor. | |
| Protected Member Functions inherited from galaxy::Serializable | |
| Serializable () noexcept=default | |
| Constructor. | |
| Serializable (Serializable &&) noexcept=default | |
| Move constructor. | |
| Serializable (const Serializable &) noexcept=default | |
| Copy constructor. | |
| Protected Attributes inherited from galaxy::State | |
| std::string | m_name |
| Name for debug purposes. | |
Represents a scene in a game.
Scenes should be logically grouped -> i.e. a map, player data + ui, battle, menu, etc. Each scene is an independant collection of systems, but not entities.
|
noexcept |
|
privatedelete |
Constructor.
|
privatedelete |
Copy constructor.
|
overridevirtual |
When scene is pushed to the stack.
Implements galaxy::State.
Definition at line 47 of file Scene.cpp.
|
overridevirtual |
When scene is popped from the stack.
Implements galaxy::State.
Definition at line 51 of file Scene.cpp.
|
virtual |
Handle an event for a scene.
| e | Event that was triggered. |
Keyboard events
Key pressed
Key released
Keyboard text editing (composition)
Keyboard text input
A new keyboard has been inserted into the system
A keyboard has been removed
Keyboard text editing candidates
Mouse events
Mouse moved
Mouse button pressed
Mouse button released
Mouse wheel motion
A new mouse has been inserted into the system
A mouse has been removed
A sensor was updated
Pressure-sensitive pen has become available
Pressure-sensitive pen has become unavailable
Pressure-sensitive pen touched drawing surface
Pressure-sensitive pen stopped touching drawing surface
Pressure-sensitive pen button pressed
Pressure-sensitive pen button released
Pressure-sensitive pen is moving on the tablet
Pressure-sensitive pen angle/pressure/etc changed
A new camera device is available
A camera device has been removed.
A camera device has been approved for use by the user.
A camera device has been denied for use by the user.
Pinch gesture started
Pinch gesture updated
Pinch gesture ended
Drag and drop events
The system requests a file open
text/plain drag-and-drop event
A new set of drops is beginning (NULL filename)
Current set of drops is now complete (NULL filename)
Position while moving over the window
Joystick axis motion
Joystick trackball motion
Joystick hat position change
Joystick button pressed
Joystick button released
A new joystick has been inserted into the system
An opened joystick has been removed
Joystick battery level change
Joystick update is complete
Gamepad axis motion
Gamepad button pressed
Gamepad button released
A new gamepad has been inserted into the system
A gamepad has been removed
The gamepad mapping was updated
Gamepad touchpad was touched
Gamepad touchpad finger was moved
Gamepad touchpad finger was lifted
Gamepad sensor was updated
Gamepad update is complete
Gamepad Steam handle has changed
|
virtual |
|
virtual |
|
nodiscardnoexcept |
|
nodiscardoverridevirtual |
Serializes object.
Implements galaxy::Serializable.
Definition at line 288 of file Scene.cpp.
|
overridevirtual |
Deserializes from object.
| json | Json object to retrieve data from. |
Implements galaxy::Serializable.
Definition at line 341 of file Scene.cpp.
Copy assignment operator.
|
private |
|
private |