Hymn to Beauty
C++ 3D Engine
Component::Trigger Class Reference

Component defining a trigger event. More...

#include <Trigger.hpp>

Inheritance diagram for Component::Trigger:
Component::SuperComponent

Public Types

enum  TriggerTypes {
  ONCE = 0 , REPEAT , LOOK_AT , PROXIMITY ,
  NUMBER_OF_TYPES
}
 

Public Member Functions

 Trigger ()
 Create new trigger. More...
 
 ~Trigger () override
 Destructor. More...
 
void Serialize (Json::Value &node, bool load) override
 Save or load component values to/from JSON. More...
 
SuperTriggerGetTrigger ()
 Get trigger of this component. More...
 
void SetTrigger (SuperTrigger *trigger)
 Get trigger of this component. More...
 
- Public Member Functions inherited from Component::SuperComponent
 SuperComponent ()
 Create new SuperComponent. More...
 
virtual ~SuperComponent ()
 Destructor. More...
 
void Kill ()
 Kill the component, will be removed at the end of the frame. More...
 
bool IsKilled () const
 Get whether component has been killed. More...
 

Public Attributes

TriggerTypes triggerType = TriggerTypes::ONCE
 What type of trigger type this component is. Set to ONCE by default. More...
 
- Public Attributes inherited from Component::SuperComponent
Entityentity = nullptr
 Pointer to which entity this component corresponds. More...
 

Friends

class ::TriggerManager
 

Detailed Description

Component defining a trigger event.

Member Enumeration Documentation

◆ TriggerTypes

Enumerator
ONCE 
REPEAT 
LOOK_AT 
PROXIMITY 
NUMBER_OF_TYPES 

Constructor & Destructor Documentation

◆ Trigger()

Trigger::Trigger ( )

Create new trigger.

◆ ~Trigger()

Trigger::~Trigger ( )
override

Destructor.

Member Function Documentation

◆ GetTrigger()

SuperTrigger * Trigger::GetTrigger ( )

Get trigger of this component.

Returns
The Trigger

◆ Serialize()

void Trigger::Serialize ( Json::Value &  node,
bool  load 
)
overridevirtual

Save or load component values to/from JSON.

Parameters
nodeThe JSON node to save to or load from.
loadWhether to load (otherwise saves).

Implements Component::SuperComponent.

◆ SetTrigger()

void Trigger::SetTrigger ( SuperTrigger trigger)

Get trigger of this component.

Parameters
triggerThe trigger to be set.

Friends And Related Function Documentation

◆ ::TriggerManager

friend class ::TriggerManager
friend

Member Data Documentation

◆ triggerType

TriggerTypes Component::Trigger::triggerType = TriggerTypes::ONCE

What type of trigger type this component is. Set to ONCE by default.


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