GameKit  0.0.1a
C++ gamedev tools
Public Member Functions | Private Types | Private Attributes | List of all members
gk::LifetimeComponent Class Reference

#include <LifetimeComponent.hpp>

Public Member Functions

 LifetimeComponent ()=default
 
 LifetimeComponent (u32 lifetime)
 
 LifetimeComponent (DeathChecker deathChecker)
 
void kill ()
 
bool almostDead ()
 
bool dead (const SceneObject &object) const
 
u32 aliveTime ()
 
bool areClientsNotified () const
 
void setDeathChecker (DeathChecker deathChecker)
 
void setClientsNotified (bool areClientsNotified)
 

Private Types

using DeathChecker = std::function< bool(const SceneObject &)>
 

Private Attributes

Timer m_timer
 
bool m_dead = false
 
bool m_areClientsNotified = false
 
u32 m_lifetime = 0
 
DeathChecker m_deathChecker
 

Detailed Description

Definition at line 24 of file LifetimeComponent.hpp.

Member Typedef Documentation

§ DeathChecker

using gk::LifetimeComponent::DeathChecker = std::function<bool(const SceneObject &)>
private

Definition at line 25 of file LifetimeComponent.hpp.

Constructor & Destructor Documentation

§ LifetimeComponent() [1/3]

gk::LifetimeComponent::LifetimeComponent ( )
default

§ LifetimeComponent() [2/3]

gk::LifetimeComponent::LifetimeComponent ( u32  lifetime)
inline

Definition at line 29 of file LifetimeComponent.hpp.

§ LifetimeComponent() [3/3]

gk::LifetimeComponent::LifetimeComponent ( DeathChecker  deathChecker)
inline

Definition at line 30 of file LifetimeComponent.hpp.

Member Function Documentation

§ aliveTime()

u32 gk::LifetimeComponent::aliveTime ( )
inline

Definition at line 42 of file LifetimeComponent.hpp.

§ almostDead()

bool gk::LifetimeComponent::almostDead ( )
inline

Definition at line 34 of file LifetimeComponent.hpp.

§ areClientsNotified()

bool gk::LifetimeComponent::areClientsNotified ( ) const
inline

Definition at line 44 of file LifetimeComponent.hpp.

§ dead()

bool gk::LifetimeComponent::dead ( const SceneObject object) const
inline

Definition at line 36 of file LifetimeComponent.hpp.

§ kill()

void gk::LifetimeComponent::kill ( )
inline

Definition at line 32 of file LifetimeComponent.hpp.

§ setClientsNotified()

void gk::LifetimeComponent::setClientsNotified ( bool  areClientsNotified)
inline

Definition at line 47 of file LifetimeComponent.hpp.

§ setDeathChecker()

void gk::LifetimeComponent::setDeathChecker ( DeathChecker  deathChecker)
inline

Definition at line 46 of file LifetimeComponent.hpp.

Member Data Documentation

§ m_areClientsNotified

bool gk::LifetimeComponent::m_areClientsNotified = false
private

Definition at line 53 of file LifetimeComponent.hpp.

§ m_dead

bool gk::LifetimeComponent::m_dead = false
private

Definition at line 52 of file LifetimeComponent.hpp.

§ m_deathChecker

DeathChecker gk::LifetimeComponent::m_deathChecker
private

Definition at line 57 of file LifetimeComponent.hpp.

§ m_lifetime

u32 gk::LifetimeComponent::m_lifetime = 0
private

Definition at line 55 of file LifetimeComponent.hpp.

§ m_timer

Timer gk::LifetimeComponent::m_timer
private

Definition at line 50 of file LifetimeComponent.hpp.


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