R-Type
R-Type project
KapEngine::SceneManagement::Scene Class Reference

Public Member Functions

 Scene (SceneManager &manager, std::string const &sceneName)
 
void addGameObject (std::shared_ptr< GameObject > go)
 
void destroyGameObject (std::shared_ptr< GameObject > const go)
 
void destroyGameObject (GameObject const &go)
 
void destroyGameObject (std::size_t id)
 
bool setId (std::size_t id)
 
std::size_t getId () const
 
std::string getName () const
 
bool operator== (Scene const &scene)
 
bool operator== (std::shared_ptr< Scene > scene)
 
bool operator!= (Scene const &scene)
 
bool operator!= (std::shared_ptr< Scene > scene)
 
ComponentgetActiveCamera () const
 
std::shared_ptr< GameObject > & getGameObject (std::size_t id)
 Get the Game Object object. More...
 
std::shared_ptr< GameObject > & getObject (std::size_t id)
 Get GameObject object. More...
 
std::shared_ptr< GameObjectgetGameObjectConst (std::size_t id) const
 
std::shared_ptr< GameObjectgetObjectConst (std::size_t id) const
 Get the Object Const object. More...
 
std::vector< std::shared_ptr< GameObject > > getAllGameObjects ()
 
std::vector< std::shared_ptr< GameObject > > getAllObjects ()
 Get the All Objects object. More...
 
std::shared_ptr< GameObject > & getGameObject (Entity const &en)
 
std::shared_ptr< GameObject > & getObject (Entity const &en)
 Get the Object object. More...
 
std::vector< std::shared_ptr< GameObject > > getGameObjects (std::string const &name)
 
std::vector< std::shared_ptr< GameObject > > getGameObjectByTag (std::string const &tag)
 
KEnginegetEngine ()
 
bool isGameObjectExists (std::size_t const &index)
 return if GameObject exists More...
 
bool isGameObjectExists (Entity const &en)
 return if GameObject exists More...
 
void __update ()
 
void __changingScene ()
 
void __engineStop (bool currentScene=false)
 
void __init ()
 
void __finit ()
 
void dump (bool showComponents=false)
 Display all objects in scene. More...
 
std::shared_ptr< GameObjectcreateGameObject (std::string const &name)
 
std::shared_ptr< GameObjectfindFirstGameObject (std::string const &name)
 get first GameObject with it's name More...
 
void registerTmpActionAfterUpdate (std::function< void(Scene &scene)> action)
 add temporary action when scene updated More...
 
bool __isChangingScene () const
 

Member Function Documentation

◆ __changingScene()

void KapEngine::SceneManagement::Scene::__changingScene ( )
Warning
Do not call or modifie this function

◆ __engineStop()

void KapEngine::SceneManagement::Scene::__engineStop ( bool  currentScene = false)
Warning
Do not call or modifie this function

◆ __finit()

void KapEngine::SceneManagement::Scene::__finit ( )
Warning
Do not call or modifie this function

◆ __init()

void KapEngine::SceneManagement::Scene::__init ( )
Warning
Do not call or modifie this function

◆ __update()

void KapEngine::SceneManagement::Scene::__update ( )
Warning
Do not call or modifie this function

◆ dump()

void KapEngine::SceneManagement::Scene::dump ( bool  showComponents = false)

Display all objects in scene.

Parameters
showComponentsif you want to display components attached to your objects

◆ findFirstGameObject()

std::shared_ptr< KapEngine::GameObject > KapEngine::SceneManagement::Scene::findFirstGameObject ( std::string const &  name)

get first GameObject with it's name

Parameters
name
Returns
std::shared_ptr<GameObject>

◆ getAllObjects()

std::vector<std::shared_ptr<GameObject> > KapEngine::SceneManagement::Scene::getAllObjects ( )
inline

Get the All Objects object.

Returns
std::vector<std::shared_ptr<GameObject>>
Deprecated:

◆ getGameObject()

std::shared_ptr< KapEngine::GameObject > & KapEngine::SceneManagement::Scene::getGameObject ( std::size_t  id)

Get the Game Object object.

Parameters
id
Returns
std::shared_ptr<GameObject>&

◆ getObject() [1/2]

std::shared_ptr<GameObject>& KapEngine::SceneManagement::Scene::getObject ( Entity const &  en)
inline

Get the Object object.

Parameters
en
Returns
std::shared_ptr<GameObject>&
Deprecated:

◆ getObject() [2/2]

std::shared_ptr<GameObject>& KapEngine::SceneManagement::Scene::getObject ( std::size_t  id)
inline

Get GameObject object.

Parameters
id
Returns
std::shared_ptr<GameObject>&
Deprecated:
please use getGameObject

◆ getObjectConst()

std::shared_ptr<GameObject> KapEngine::SceneManagement::Scene::getObjectConst ( std::size_t  id) const
inline

Get the Object Const object.

Parameters
id
Returns
std::shared_ptr<GameObject>
Deprecated:

◆ isGameObjectExists() [1/2]

bool KapEngine::SceneManagement::Scene::isGameObjectExists ( Entity const &  en)

return if GameObject exists

Parameters
index
Returns
true
false

◆ isGameObjectExists() [2/2]

bool KapEngine::SceneManagement::Scene::isGameObjectExists ( std::size_t const &  index)

return if GameObject exists

Parameters
index
Returns
true
false

◆ registerTmpActionAfterUpdate()

void KapEngine::SceneManagement::Scene::registerTmpActionAfterUpdate ( std::function< void(Scene &scene)>  action)
inline

add temporary action when scene updated

Parameters
action

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