raylibstarter 0.1.0
game::core::Scene Class Referenceabstract

Scene base class. Scenes are managed by the Stage object. More...

#include <scene.h>

Inheritance diagram for game::core::Scene:
Collaboration diagram for game::core::Scene:

Public Member Functions

 Scene ()
 
virtual ~Scene ()
 
virtual void Update ()=0
 The Update() method is used to process input and update the game state. It is called automatically before Draw() is called. More...
 
virtual void Draw ()=0
 The Draw() method can be used to output graphics. Note that the elements of the actor map are drawn automatically. More...
 

Public Attributes

std::map< std::string, std::shared_ptr< game::core::Actor > > actors = { }
 Actors of the scene. The Actor objects of this map are drawn automatically by the Stage object if their visibility attribute is true. More...
 

Detailed Description

Scene base class. Scenes are managed by the Stage object.

Scenes are one basic element of this engine. They contain the actual game-play elements. Scene classes derived from this base class implement an Update() method to manipulate the game state and draw graphics via the Draw() method to be implemented.

A scene object contains actors that are automatically drawn by the Stage object. Actor objects can be placed in the actor-map of a scene object and will be drawn automatically if their visible attribute is true. If actor objects are supposed to be available across scenes, they can also be stored in game::core::actors. Objects that are only referenced there will not be drawn automatically.

Definition at line 23 of file scene.h.

Constructor & Destructor Documentation

◆ Scene()

game::core::Scene::Scene ( )
inline

Definition at line 28 of file scene.h.

◆ ~Scene()

virtual game::core::Scene::~Scene ( )
inlinevirtual

Definition at line 32 of file scene.h.

Member Function Documentation

◆ Draw()

virtual void game::core::Scene::Draw ( )
pure virtual

The Draw() method can be used to output graphics. Note that the elements of the actor map are drawn automatically.

Implemented in game::scenes::GameScene, game::scenes::MenuScene, and game::scenes::PauseScene.

◆ Update()

virtual void game::core::Scene::Update ( )
pure virtual

The Update() method is used to process input and update the game state. It is called automatically before Draw() is called.

Implemented in game::scenes::GameScene, game::scenes::MenuScene, and game::scenes::PauseScene.

Member Data Documentation

◆ actors

std::map<std::string, std::shared_ptr<game::core::Actor> > game::core::Scene::actors = { }

Actors of the scene. The Actor objects of this map are drawn automatically by the Stage object if their visibility attribute is true.

Definition at line 26 of file scene.h.


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