Overload  1.1
Game engine with editor
Classes | Public Member Functions | List of all members
OvCore::SceneSystem::Scene Class Reference

#include <Scene.h>

Inheritance diagram for OvCore::SceneSystem::Scene:
OvCore::API::ISerializable

Classes

struct  FastAccessComponents
 

Public Member Functions

 Scene ()
 
 ~Scene ()
 
void Play ()
 
bool IsPlaying () const
 
void Update (float p_deltaTime)
 
void FixedUpdate (float p_deltaTime)
 
void LateUpdate (float p_deltaTime)
 
ECS::ActorCreateActor ()
 
ECS::ActorCreateActor (const std::string &p_name, const std::string &p_tag="")
 
bool DestroyActor (ECS::Actor &p_target)
 
void CollectGarbages ()
 
ECS::ActorFindActorByName (const std::string &p_name)
 
ECS::ActorFindActorByTag (const std::string &p_tag)
 
ECS::ActorFindActorByID (int64_t p_id)
 
std::vector< std::reference_wrapper< ECS::Actor > > FindActorsByName (const std::string &p_name)
 
std::vector< std::reference_wrapper< ECS::Actor > > FindActorsByTag (const std::string &p_tag)
 
void OnComponentAdded (ECS::Components::AComponent &p_compononent)
 
void OnComponentRemoved (ECS::Components::AComponent &p_compononent)
 
std::vector< OvCore::ECS::Actor * > & GetActors ()
 
const FastAccessComponentsGetFastAccessComponents () const
 
virtual void OnSerialize (tinyxml2::XMLDocument &p_doc, tinyxml2::XMLNode *p_root) override
 
virtual void OnDeserialize (tinyxml2::XMLDocument &p_doc, tinyxml2::XMLNode *p_root) override
 

Detailed Description

The scene is a set of actors

Constructor & Destructor Documentation

◆ Scene()

OvCore::SceneSystem::Scene::Scene ( )

Constructor of the scene

@project: Overload

Author
: Overload Tech. @restrictions: This software may not be resold, redistributed or otherwise conveyed to a third party.

◆ ~Scene()

OvCore::SceneSystem::Scene::~Scene ( )

Handle the memory de-allocation of every actors

Member Function Documentation

◆ CollectGarbages()

void OvCore::SceneSystem::Scene::CollectGarbages ( )

Collect garbages by removing Destroyed-marked actors

◆ CreateActor() [1/2]

OvCore::ECS::Actor & OvCore::SceneSystem::Scene::CreateActor ( )

Create an actor with a default name and return a reference to it.

◆ CreateActor() [2/2]

OvCore::ECS::Actor & OvCore::SceneSystem::Scene::CreateActor ( const std::string &  p_name,
const std::string &  p_tag = "" 
)

Create an actor with the given name and return a reference to it.

Parameters
p_name
p_tag

◆ DestroyActor()

bool OvCore::SceneSystem::Scene::DestroyActor ( ECS::Actor p_target)

Destroy and actor and return true on success

Parameters
p_target(The actor to remove from the scene)

◆ FindActorByID()

OvCore::ECS::Actor * OvCore::SceneSystem::Scene::FindActorByID ( int64_t  p_id)

Return the actor identified by the given ID (Returns 0 on fail)

Parameters
p_id

◆ FindActorByName()

OvCore::ECS::Actor * OvCore::SceneSystem::Scene::FindActorByName ( const std::string &  p_name)

Return the first actor identified by the given name, or nullptr on fail

Parameters
p_name

◆ FindActorByTag()

OvCore::ECS::Actor * OvCore::SceneSystem::Scene::FindActorByTag ( const std::string &  p_tag)

Return the first actor identified by the given tag, or nullptr on fail

Parameters
p_tag

◆ FindActorsByName()

std::vector< std::reference_wrapper< OvCore::ECS::Actor > > OvCore::SceneSystem::Scene::FindActorsByName ( const std::string &  p_name)

Return every actors identified by the given name

Parameters
p_name

◆ FindActorsByTag()

std::vector< std::reference_wrapper< OvCore::ECS::Actor > > OvCore::SceneSystem::Scene::FindActorsByTag ( const std::string &  p_tag)

Return every actors identified by the given tag

Parameters
p_tag

◆ FixedUpdate()

void OvCore::SceneSystem::Scene::FixedUpdate ( float  p_deltaTime)

Update every actors 60 frames per seconds

Parameters
p_deltaTime

◆ GetActors()

std::vector< OvCore::ECS::Actor * > & OvCore::SceneSystem::Scene::GetActors ( )

Return a reference on the actor map

◆ GetFastAccessComponents()

const OvCore::SceneSystem::Scene::FastAccessComponents & OvCore::SceneSystem::Scene::GetFastAccessComponents ( ) const

Return the fast access components data structure

◆ IsPlaying()

bool OvCore::SceneSystem::Scene::IsPlaying ( ) const

Returns true if the scene is playing

◆ LateUpdate()

void OvCore::SceneSystem::Scene::LateUpdate ( float  p_deltaTime)

Update every actors lately

Parameters
p_deltaTime

◆ OnComponentAdded()

void OvCore::SceneSystem::Scene::OnComponentAdded ( ECS::Components::AComponent p_compononent)

Callback method called everytime a component is added on an actor of the scene

Parameters
p_component

◆ OnComponentRemoved()

void OvCore::SceneSystem::Scene::OnComponentRemoved ( ECS::Components::AComponent p_compononent)

Callback method called everytime a component is removed on an actor of the scene

Parameters
p_component

◆ OnDeserialize()

void OvCore::SceneSystem::Scene::OnDeserialize ( tinyxml2::XMLDocument &  p_doc,
tinyxml2::XMLNode *  p_root 
)
overridevirtual

Deserialize the scene

Parameters
p_doc
p_root

Implements OvCore::API::ISerializable.

◆ OnSerialize()

void OvCore::SceneSystem::Scene::OnSerialize ( tinyxml2::XMLDocument &  p_doc,
tinyxml2::XMLNode *  p_root 
)
overridevirtual

Serialize the scene

Parameters
p_doc
p_root

Implements OvCore::API::ISerializable.

◆ Play()

void OvCore::SceneSystem::Scene::Play ( )

Play the scene

◆ Update()

void OvCore::SceneSystem::Scene::Update ( float  p_deltaTime)

Update every actors

Parameters
p_deltaTime

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