Nymph Game Engine
Chaiscript based Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Game::Scene Class Reference

A container holding a base transform, a vector of components, and a vector of entities. More...

#include <scene.h>

Public Member Functions

 Scene ()=delete
 
 Scene (const std::string scene_name)
 Scene constructor. More...
 
void setTransform (std::shared_ptr< Transform > transform) noexcept
 Sets the transform. More...
 
std::shared_ptr< TransformgetTransform () const noexcept
 Gets the transform. More...
 
void addComponent (std::shared_ptr< Component > component)
 Adds a component. More...
 
void addComponent (std::shared_ptr< Physics::CollisionData > collision_data)
 Adds a collision data component. More...
 
void addComponents (std::vector< std::shared_ptr< Component >> components)
 Adds components. More...
 
std::vector< std::shared_ptr
< Component > > 
getComponents () const noexcept
 Gets all components. More...
 
std::shared_ptr
< Physics::CollisionData
getCollisionData () const noexcept
 Gets the collision data. More...
 
void addEntity (std::shared_ptr< Entity > entity) noexcept
 Adds an entity. More...
 
void addEntities (std::vector< std::shared_ptr< Entity >> entities) noexcept
 Adds entities. More...
 
std::vector< std::shared_ptr
< Entity > > 
getEntities () const noexcept
 Gets all entities. More...
 
void setName (const std::string name) noexcept
 Sets the name. More...
 
std::string getName () const noexcept
 Gets the name. More...
 
std::string to_string () const noexcept
 Returns a string representation of the object, mostly for use in chaiscript. More...
 

Detailed Description

A container holding a base transform, a vector of components, and a vector of entities.

Constructor & Destructor Documentation

Game::Scene::Scene ( )
delete
Game::Scene::Scene ( const std::string  scene_name)

Scene constructor.

Parameters
[in]scene_nameThe name of the scene.

Member Function Documentation

void Game::Scene::addComponent ( std::shared_ptr< Component component)

Adds a component.

Parameters
[in]componentThe component

Referenced by generated::getSceneModule().

void Game::Scene::addComponent ( std::shared_ptr< Physics::CollisionData collision_data)

Adds a collision data component.

Parameters
[in]collision_dataThe collision data
void Game::Scene::addComponents ( std::vector< std::shared_ptr< Component >>  components)

Adds components.

Parameters
[in]componentsThe components

Referenced by generated::getSceneModule().

void Game::Scene::addEntities ( std::vector< std::shared_ptr< Entity >>  entities)
noexcept

Adds entities.

Parameters
[in]entitiesThe entities

Referenced by generated::getSceneModule().

void Game::Scene::addEntity ( std::shared_ptr< Entity entity)
noexcept

Adds an entity.

Parameters
[in]entityThe entity

Referenced by generated::getSceneModule().

std::shared_ptr< Physics::CollisionData > Game::Scene::getCollisionData ( ) const
noexcept

Gets the collision data.

Returns
The collision data.

Referenced by generated::getSceneModule(), and to_string().

std::vector< std::shared_ptr< Component > > Game::Scene::getComponents ( ) const
noexcept

Gets all components.

Returns
A vector of components

Referenced by generated::getSceneModule().

std::vector< std::shared_ptr< Entity > > Game::Scene::getEntities ( ) const
noexcept

Gets all entities.

Returns
A vector of entities

Referenced by generated::getSceneModule().

std::string Game::Scene::getName ( ) const
noexcept

Gets the name.

Returns
The name.

Referenced by generated::getSceneModule(), and to_string().

std::shared_ptr< Transform > Game::Scene::getTransform ( ) const
noexcept

Gets the transform.

Returns
The transform.

Referenced by generated::getSceneModule().

void Game::Scene::setName ( const std::string  name)
noexcept

Sets the name.

Parameters
[in]nameThe name

Referenced by generated::getSceneModule().

void Game::Scene::setTransform ( std::shared_ptr< Transform transform)
noexcept

Sets the transform.

Parameters
[in]transformThe transform

Referenced by generated::getSceneModule().

std::string Game::Scene::to_string ( ) const
noexcept

Returns a string representation of the object, mostly for use in chaiscript.

Returns
String representation of the object.

References getCollisionData(), and getName().

Referenced by generated::getSceneModule().


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