Level H Engine
Public Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
Component Class Reference

A class that handles the components. More...

#include <Component.h>

Inheritance diagram for Component:
Inheritance graph
Collaboration diagram for Component:
Collaboration graph

Public Member Functions

virtual ~Component ()
 A virtual destructor. More...
 
std::weak_ptr< GameObjectgetGameObject ()
 A function to get the game object linked with the component. More...
 
virtual void onAwake ()
 A virtual function for the componets awake. More...
 
virtual void onUpdate ()
 A virtual function for the componets update. More...
 
virtual void onRender ()
 A virtual function for the componets render. More...
 
virtual void onDestroy ()
 A virtual function for the componets destroy. More...
 
void setDestroyed (bool inDestroyed)
 A function to set the componets destroyed boolean. More...
 
bool getDestroyed ()
 A function to get the componets destroyed boolean. More...
 
std::string getID ()
 A function to set the components type ID. More...
 

Protected Attributes

std::string id
 The ID of the component type. More...
 

Private Attributes

std::weak_ptr< GameObjectgameObject
 A weak pointer to the linked game object. More...
 
bool destroyed
 A boolean for if the component has been destroyed. More...
 

Friends

class GameObject
 Declare the game object as a friend. More...
 

Detailed Description

A class that handles the components.

Constructor & Destructor Documentation

◆ ~Component()

Component::~Component ( )
virtual

A virtual destructor.

Member Function Documentation

◆ getDestroyed()

bool Component::getDestroyed ( )
inline

A function to get the componets destroyed boolean.

Returns
The boolean for the state of destroyed.

◆ getGameObject()

std::weak_ptr< GameObject > Component::getGameObject ( )

A function to get the game object linked with the component.

Returns
Returns a weak pointer to the linked game object.
Here is the caller graph for this function:

◆ getID()

std::string Component::getID ( )
inline

A function to set the components type ID.

Parameters
idThe components type ID.

◆ onAwake()

void Component::onAwake ( )
virtual

◆ onDestroy()

void Component::onDestroy ( )
virtual

◆ onRender()

void Component::onRender ( )
virtual

A virtual function for the componets render.

Reimplemented in ModelComponent.

◆ onUpdate()

void Component::onUpdate ( )
virtual

A virtual function for the componets update.

◆ setDestroyed()

void Component::setDestroyed ( bool  inDestroyed)
inline

A function to set the componets destroyed boolean.

Parameters
inDestroyedA boolean for the state of destroyed.

Friends And Related Function Documentation

◆ GameObject

friend class GameObject
friend

Declare the game object as a friend.

Member Data Documentation

◆ destroyed

bool Component::destroyed
private

A boolean for if the component has been destroyed.

◆ gameObject

std::weak_ptr<GameObject> Component::gameObject
private

A weak pointer to the linked game object.

◆ id

std::string Component::id
protected

The ID of the component type.


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