MAGE  v0.171.0
Matthias Advanced Game Engine
mage::Component Class Reference

#include <component.hpp>

Inheritance diagram for mage::Component:
mage::BehaviorScript mage::rendering::AmbientLight mage::rendering::Camera mage::rendering::DirectionalLight mage::rendering::Model mage::rendering::OmniLight mage::rendering::SpotLight mage::rendering::SpriteImage mage::rendering::SpriteText

Public Member Functions

virtual ~Component ()
 
Componentoperator= (const Component &component) noexcept
 
Componentoperator= (Component &&component) noexcept
 
State GetState () const noexcept
 
void SetState (State state) noexcept
 
U64 GetGuid () const noexcept
 
bool HasOwner () const noexcept
 
ProxyPtr< NodeGetOwner () noexcept
 
ProxyPtr< const NodeGetOwner () const noexcept
 

Protected Member Functions

 Component () noexcept
 
 Component (const Component &component) noexcept
 
 Component (Component &&component) noexcept
 

Private Member Functions

void SetOwner (ProxyPtr< Node > owner) noexcept
 

Private Attributes

State m_state
 
U64 m_guid
 
ProxyPtr< Nodem_owner
 

Friends

class ComponentClient
 

Detailed Description

A class of components.

Constructor & Destructor Documentation

◆ ~Component()

mage::Component::~Component ( )
virtualdefault

Destructs this component.

◆ Component() [1/3]

mage::Component::Component ( )
protectednoexcept

Constructs a component.

◆ Component() [2/3]

mage::Component::Component ( const Component component)
protectednoexcept

Constructs a component from the given component.

Parameters
[in]componentA reference to the component to copy.

◆ Component() [3/3]

mage::Component::Component ( Component &&  component)
protecteddefaultnoexcept

Constructs a component by moving the given component.

Parameters
[in]componentA reference to the component to move.

Member Function Documentation

◆ GetGuid()

U64 mage::Component::GetGuid ( ) const
noexcept

Returns the guid of this component.

Returns
The guid of this component.

◆ GetOwner() [1/2]

ProxyPtr< Node > mage::Component::GetOwner ( )
noexcept

Returns the owner of this component.

Returns
A pointer to the owner of this component.

◆ GetOwner() [2/2]

ProxyPtr< const Node > mage::Component::GetOwner ( ) const
noexcept

Returns the owner of this component.

Returns
A pointer to the owner of this component.

◆ GetState()

State mage::Component::GetState ( ) const
noexcept

Returns the state of this component.

Returns
The state of this component.

◆ HasOwner()

bool mage::Component::HasOwner ( ) const
noexcept

Checks whether this component has an owner.

Returns
true if this component has an owner. false otherwise.

◆ operator=() [1/2]

Component & mage::Component::operator= ( const Component component)
noexcept

Copies the given component to this component.

Parameters
[in]componentA reference to the component to copy.
Returns
A reference to the copy of the given component (i.e. this component).

◆ operator=() [2/2]

Component & mage::Component::operator= ( Component &&  component)
defaultnoexcept

Moves the given component to this component.

Parameters
[in]componentA reference to the component to move.
Returns
A reference to the moved component (i.e. this component).

◆ SetOwner()

void mage::Component::SetOwner ( ProxyPtr< Node owner)
privatenoexcept

Sets the owner of this component to the given owner.

Parameters
[in]ownerA pointer to the owner.

◆ SetState()

void mage::Component::SetState ( State  state)
noexcept

Sets the state of this component to the given state.

Parameters
[in]stateThe state.

Friends And Related Function Documentation

◆ ComponentClient

friend class ComponentClient
friend

Member Data Documentation

◆ m_guid

U64 mage::Component::m_guid
private

The guid of this component.

◆ m_owner

ProxyPtr< Node > mage::Component::m_owner
private

A pointer to the node owning this component.

◆ m_state

State mage::Component::m_state
private

The state of this component.