flimEngine
SceneManager Class Reference

Manager for scenes. More...

#include <SceneManager.h>

Collaboration diagram for SceneManager:
Collaboration graph

Static Public Member Functions

static errcode Register (Updatable *in)
 Registers an updatable to the scene. More...
 
static errcode Deregister (Updatable *in)
 Deregisters this Updatable to the scene. More...
 
static errcode Register (GameObject *in)
 Registers this object. More...
 
static errcode Deregister (GameObject *in)
 Deregisters this object. More...
 
static errcode Register (Drawable *in)
 Registers this object. More...
 
static Camera & GetMainCamera ()
 Gets main camera. More...
 
static Camera & Get2DCamera ()
 Gets 2D camera. More...
 
static errcode Deregister (Drawable *in)
 Deregisters this object. More...
 
static errcode Register (Inputable *in, AZUL_KEY key, input_type type)
 Registers this object. More...
 
static errcode Deregister (Inputable *in, AZUL_KEY key, input_type type)
 Deregisters this object. More...
 
static errcode Register (float t, Alarmable *in, AlarmableManager::ALARM_ID id)
 Registers this object. More...
 
static errcode Deregister (Alarmable *in, AlarmableManager::ALARM_ID id)
 Deregisters this object. More...
 
static errcode SetStartScene (Scene *in)
 Sets start scene. More...
 
static SceneGetCurrentScene ()
 Gets current scene. More...
 
static errcode ChangeScene (Scene *in)
 Change scene. More...
 
static errcode SetCurrentScene (Scene *in)
 Sets current scene. More...
 
static errcode Initialize ()
 Initialization callback hook into current scene. More...
 
static errcode Update ()
 Update callback hook. More...
 
static errcode Draw ()
 Draw callback hook. More...
 
static errcode Terminate ()
 Terminate callback hook for the user on their scene. More...
 
static errcode ShutDownCamera ()
 Shut down camera. More...
 
static FlimTerraingetTerrain ()
 Gets the terrain. More...
 

Private Member Functions

 SceneManager ()=default
 
 SceneManager (const SceneManager &)=delete
 
 ~SceneManager ()
 
const SceneManageroperator= (const SceneManager &)=delete
 
errcode privSceneChanged ()
 
errcode privChangeScene (Scene *in)
 
errcode privSetStartScene (Scene *in)
 
errcode privGetCurrentScene (Scene *&out)
 
errcode privSetCurrentScene (Scene *in)
 
errcode privInitialize ()
 
errcode privUpdate ()
 
errcode privDraw ()
 
errcode privTerminate ()
 
errcode privRegister (Updatable *in)
 
errcode privDeregister (Updatable *in)
 
errcode privRegister (GameObject *in)
 
errcode privDeregister (GameObject *in)
 
errcode privRegister (Drawable *in)
 
errcode privDeregister (Drawable *in)
 
errcode privRegister (Inputable *in, AZUL_KEY key, input_type type)
 
errcode privDeregister (Inputable *in, AZUL_KEY key, input_type type)
 
errcode privRegister (float t, Alarmable *in, AlarmableManager::ALARM_ID id)
 
errcode privDeregister (Alarmable *in, AlarmableManager::ALARM_ID id)
 

Static Private Member Functions

static SceneManagerInstance ()
 
static errcode SceneChanged ()
 

Private Attributes

ScenecurrentScene
 
Executionerexecutioner
 
CommandcurrentCommand
 
SceneUpdateCommandupdateCommand
 

Static Private Attributes

static SceneManagerinstance = nullptr
 

Friends

class SceneChangeCommand
 
class SceneUpdateCommand
 

Detailed Description

Manager for scenes.

Author
Jack Campbell
Date
6/1/2017

Constructor & Destructor Documentation

◆ SceneManager() [1/2]

SceneManager::SceneManager ( )
privatedefault

◆ SceneManager() [2/2]

SceneManager::SceneManager ( const SceneManager )
privatedelete

◆ ~SceneManager()

SceneManager::~SceneManager ( )
inlineprivate

Member Function Documentation

◆ Deregister() [1/5]

static errcode SceneManager::Deregister ( Updatable in)
inlinestatic

Deregisters this Updatable to the scene.

Author
Jack Campbell
Date
3/5/2017
Parameters
[in,out]inUpdatable to deregister.
Returns
An errcode.

◆ Deregister() [2/5]

static errcode SceneManager::Deregister ( GameObject in)
inlinestatic

Deregisters this object.

Author
Jack Campbell
Date
3/5/2017
Parameters
[in,out]inIf non-null, the in.
Returns
An errcode.

◆ Deregister() [3/5]

static errcode SceneManager::Deregister ( Drawable in)
inlinestatic

Deregisters this object.

Author
Jack Campbell
Date
3/5/2017
Parameters
[in,out]inIf non-null, the in.
Returns
An errcode.

◆ Deregister() [4/5]

static errcode SceneManager::Deregister ( Inputable in,
AZUL_KEY  key,
input_type  type 
)
inlinestatic

Deregisters this object.

Author
Jack Campbell
Date
3/5/2017
Parameters
[in,out]inIf non-null, the in.
keyThe key.
typeThe type.
Returns
An errcode.

◆ Deregister() [5/5]

static errcode SceneManager::Deregister ( Alarmable in,
AlarmableManager::ALARM_ID  id 
)
inlinestatic

Deregisters this object.

Author
Jack Campbell
Date
3/5/2017
Parameters
[in,out]inIf non-null, the in.
idThe identifier.
Returns
An errcode.

◆ Draw()

static errcode SceneManager::Draw ( )
inlinestatic

Draw callback hook.

Author
Jack Campbell
Date
3/5/2017
Returns
An errcode.

◆ Get2DCamera()

static Camera & SceneManager::Get2DCamera ( )
inlinestatic

Gets 2D camera.

Author
Jack Campbell
Date
3/12/2017
Shortcut for getting the 2D camera.
Camera* camera = &SceneManager::Get2DCamera();
Returns
The 2D camera.

◆ getTerrain()

static FlimTerrain * SceneManager::getTerrain ( )
inlinestatic

Gets the terrain.

Author
Jack Campbell
Date
6/1/2017
Returns
Null if it fails, else the terrain.

◆ Initialize()

static errcode SceneManager::Initialize ( )
inlinestatic

Initialization callback hook into current scene.

Author
Jack Campbell
Date
3/5/2017
Returns
An errcode.

◆ Instance()

static SceneManager& SceneManager::Instance ( )
inlinestaticprivate

◆ operator=()

const SceneManager& SceneManager::operator= ( const SceneManager )
privatedelete

◆ privChangeScene()

errcode SceneManager::privChangeScene ( Scene in)
private

◆ privDeregister() [1/5]

errcode SceneManager::privDeregister ( Updatable in)
private

◆ privDeregister() [2/5]

errcode SceneManager::privDeregister ( GameObject in)
private

◆ privDeregister() [3/5]

errcode SceneManager::privDeregister ( Drawable in)
private

◆ privDeregister() [4/5]

errcode SceneManager::privDeregister ( Inputable in,
AZUL_KEY  key,
input_type  type 
)
private

◆ privDeregister() [5/5]

errcode SceneManager::privDeregister ( Alarmable in,
AlarmableManager::ALARM_ID  id 
)
private

◆ privDraw()

errcode SceneManager::privDraw ( )
private

◆ privGetCurrentScene()

errcode SceneManager::privGetCurrentScene ( Scene *&  out)
private

◆ privInitialize()

errcode SceneManager::privInitialize ( )
private

◆ privRegister() [1/5]

errcode SceneManager::privRegister ( Updatable in)
private

◆ privRegister() [2/5]

errcode SceneManager::privRegister ( GameObject in)
private

◆ privRegister() [3/5]

errcode SceneManager::privRegister ( Drawable in)
private

◆ privRegister() [4/5]

errcode SceneManager::privRegister ( Inputable in,
AZUL_KEY  key,
input_type  type 
)
private

◆ privRegister() [5/5]

errcode SceneManager::privRegister ( float  t,
Alarmable in,
AlarmableManager::ALARM_ID  id 
)
private

◆ privSceneChanged()

errcode SceneManager::privSceneChanged ( )
private

◆ privSetCurrentScene()

errcode SceneManager::privSetCurrentScene ( Scene in)
private

◆ privSetStartScene()

errcode SceneManager::privSetStartScene ( Scene in)
private

◆ privTerminate()

errcode SceneManager::privTerminate ( )
private

◆ privUpdate()

errcode SceneManager::privUpdate ( )
private

◆ Register() [1/5]

static errcode SceneManager::Register ( Updatable in)
inlinestatic

Registers an updatable to the scene.

Author
Jack Campbell
Date
3/5/2017
Parameters
[in,out]inUpdatable to register.
Returns
An errcode.

◆ Register() [2/5]

static errcode SceneManager::Register ( GameObject in)
inlinestatic

Registers this object.

Author
Jack Campbell
Date
3/5/2017
Parameters
[in,out]inIf non-null, the in.
Returns
An errcode.

◆ Register() [3/5]

static errcode SceneManager::Register ( Drawable in)
inlinestatic

Registers this object.

Author
Jack Campbell
Date
3/5/2017
Parameters
[in,out]inIf non-null, the in.
Returns
An errcode.

◆ Register() [4/5]

static errcode SceneManager::Register ( Inputable in,
AZUL_KEY  key,
input_type  type 
)
inlinestatic

Registers this object.

Author
Jack Campbell
Date
3/5/2017
Parameters
[in,out]inIf non-null, the in.
keyThe key.
typeThe type.
Returns
An errcode.

◆ Register() [5/5]

static errcode SceneManager::Register ( float  t,
Alarmable in,
AlarmableManager::ALARM_ID  id 
)
inlinestatic

Registers this object.

Author
Jack Campbell
Date
3/5/2017
Parameters
tThe float to process.
[in,out]inIf non-null, the in.
idThe identifier.
Returns
An errcode.

◆ SceneChanged()

static errcode SceneManager::SceneChanged ( )
inlinestaticprivate

◆ SetCurrentScene()

static errcode SceneManager::SetCurrentScene ( Scene in)
inlinestatic

Sets current scene.

Author
Jack Campbell
Date
3/5/2017
Parameters
[in,out]inScene to set.
Used by SceneChange command to change the scene
Returns
An errcode.

◆ ShutDownCamera()

static errcode SceneManager::ShutDownCamera ( )
inlinestatic

Shut down camera.

Author
Jack Campbell
Date
3/12/2017
Shuts down the camera manager.
Returns
An errcode.

◆ Terminate()

static errcode SceneManager::Terminate ( )
inlinestatic

Terminate callback hook for the user on their scene.

Author
Jack Campbell
Date
3/5/2017
Returns
An errcode.

◆ Update()

static errcode SceneManager::Update ( )
inlinestatic

Update callback hook.

Author
Jack Campbell
Date
3/5/2017
Returns
An errcode.

Friends And Related Function Documentation

◆ SceneChangeCommand

friend class SceneChangeCommand
friend

◆ SceneUpdateCommand

friend class SceneUpdateCommand
friend

Member Data Documentation

◆ currentCommand

Command* SceneManager::currentCommand
private

◆ currentScene

Scene* SceneManager::currentScene
private

◆ executioner

Executioner* SceneManager::executioner
private

◆ instance

SceneManager * SceneManager::instance = nullptr
staticprivate

◆ updateCommand

SceneUpdateCommand* SceneManager::updateCommand
private

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