Rune Engine  Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
rune::Component Class Reference

A component of a rune::GameObject, this class is used to add functionality to a object in the game world. More...

#include <component.h>

Inheritance diagram for rune::Component:
Collaboration diagram for rune::Component:

Public Member Functions

 Component ()=default
 Default constructor to set up.
 
virtual void awake ()
 A function that will be called before all other start functions but after the component has been assigned to a GameObject.
 
virtual void start ()
 A function for each component that is called once at the beginning of the components lifetime.
 
virtual void update ()
 A function for each component that is called every frame.
 
virtual void fixedUpdate ()
 A function for each component that is called once every physics update.
 
void setParent (GameObject *newParent)
 A function to set the pointer to the parent rune::GameObject for each component. More...
 
void setEnable (bool newEnable)
 Enable or disable the component. More...
 
bool isComponentEnabled (void)
 Gets whether or not the current component is enabled.
 
void onNotify (Signal const &signal) override
 A virtual method to be overridden by a concrete implementation of the observer class.
 

Protected Attributes

GameObjectparentObject = nullptr
 The rune::GameObject that this component is attached to. If not attached to a rune::GameObject this will equal nullptr.
 
bool isEnabled = true
 Whether or not the component is currently enabled. If not enabled, update function will not be called.
 

Detailed Description

A component of a rune::GameObject, this class is used to add functionality to a object in the game world.

Author
Thomas Montano
Date
June 9 2020

Member Function Documentation

◆ setEnable()

void rune::Component::setEnable ( bool  newEnable)

Enable or disable the component.

Parameters
newEnableThis value will replace the current value of the isEnable variable;

◆ setParent()

void rune::Component::setParent ( GameObject newParent)

A function to set the pointer to the parent rune::GameObject for each component.

Parameters
newParentA pointer to the rune::GameObject that this component belongs to.

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