|
ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
|
Base class for game scenes. More...
#include <scene.h>
Public Member Functions | |
| Scene (SceneManager< T > &manager) | |
| Constructor for the Scene class. | |
| virtual | ~Scene ()=default |
| Destructor for the Scene class. | |
| virtual void | init () |
| Initialize the game scene. | |
| virtual void | update (float dt) |
| Update the game scene. | |
| virtual void | draw () |
| Draw the game scene. | |
| virtual void | cleanup () |
| Clean up the game scene. | |
| void | register_object (const std::shared_ptr< game::GameObject > &obj) |
| Add a game object to the scene. | |
| template<typename ObjectType , typename... Args> | |
| std::shared_ptr< ObjectType > | create_object (Args &&... args) |
| Create a new game object in the scene. | |
| const std::vector< std::shared_ptr< game::GameObject > > & | get_objects () const |
| Get game objects in the scene. | |
| template<typename ObjectType > | |
| std::vector< std::shared_ptr< ObjectType > > | get_object_view () |
| Get game objects of a specific type in the scene. | |
Protected Attributes | |
| SceneManager< T > & | manager |
| Reference to the scene manager. | |
Private Attributes | |
| std::vector< std::shared_ptr< game::GameObject > > | _objects |
| Collection of game objects in the scene. | |
| std::vector< std::shared_ptr< game::GameObject > > | _obj_to_create |
| Objects to be created in the next frame. | |
Base class for game scenes.
| T | The type of the scene ID. |
This class defines the interface for game scenes in the scene engine.
|
inlineexplicit |
Constructor for the Scene class.
| manager | Reference to the SceneManager object. |
This constructor initializes the scene engine reference.
|
virtualdefault |
Destructor for the Scene class.
|
inlinevirtual |
Clean up the game scene.
Called when the game switches away from this scene. Removes all objects by default, including ones queued by create_object() that have not been added yet.
|
inline |
|
inlinevirtual |
|
inline |
|
inline |
|
inlinevirtual |
|
inline |
|
inlinevirtual |
|
private |
|
private |
|
protected |