Tramway SDK
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
tram::Ext::Kitchensink::TriggerHurt Class Reference

#include <entities.h>

Inheritance diagram for tram::Ext::Kitchensink::TriggerHurt:
tram::Entity

Public Member Functions

 TriggerHurt (const SharedEntityData &, const ValueArray &)
 
void UpdateParameters ()
 Called when Entity::UpdateTransform is called. More...
 
void SetParameters ()
 Called when either Entity::SetLocation or Entity::SetRotation is called. More...
 
void Load ()
 Loads an entity. More...
 
void Unload ()
 Unloads an entity. More...
 
void Serialize ()
 
void MessageHandler (Message &msg)
 Allows entities to receive messages. More...
 
- Public Member Functions inherited from tram::Entity
 Entity ()
 Creates an unnamed entity with a random ID. More...
 
 Entity (name_t name)
 Creates a named entity with a random ID. More...
 
 Entity (const SharedEntityData &)
 Creates an entity from a SharedEntityData. More...
 
virtual ~Entity ()
 Destructs the entity. More...
 
name_t GetName () const
 
id_t GetID () const
 
WorldCellGetCell ()
 Returns the entity's parent cell. More...
 
bool IsLoaded () const
 Returns the entity load status. More...
 
bool IsAutoLoad () const
 Returns the auto load flag status. More...
 
bool IsPersistent () const
 Returns the persistence status of an entity. More...
 
bool IsChanged () const
 
bool IsDeleted () const
 Returns the entity deletion status. More...
 
bool IsLoadedFromDisk () const
 
void Yeet ()
 Purges the entity. More...
 
void SetAutoLoad (bool is)
 
void SetPersistent (bool is)
 
void SetLocation (vec3 loc)
 
void SetRotation (quat rot)
 
void UpdateTransform (const vec3 &loc, const quat &rot)
 
const vec3GetLocation ()
 
const quatGetRotation ()
 
virtual void EventHandler (Event &event)
 Allows entities to receive events. More...
 
virtual name_t GetType ()=0
 Returns the type of the entity. More...
 
void CheckTransition ()
 Check whether an entity has entered a different cell. More...
 
SignalTableGetSignalTable ()
 

Static Public Member Functions

static void Register ()
 
- Static Public Member Functions inherited from tram::Entity
static void Update ()
 Updates entities. More...
 
static void RegisterType (name_t name, entity_make, entity_clear, const Type *fields, size_t fieldcount)
 Registers a new entity type. More...
 
static void RegisterType (name_t name, entity_make, entity_clear, const FieldInfo *fields, size_t fieldcount)
 Registers a new entity type. More...
 
static void RegisterType (name_t name, entity_make, entity_clear, std::initializer_list< FieldInfo > fields)
 Registers a new entity type. More...
 
static EntityMake (name_t type, File *file)
 Loads an Entity from a File. More...
 
static EntityMake (name_t type, const SharedEntityData &, const ValueArray &)
 Creates an entity. More...
 
static EntityFind (id_t entity_id)
 Finds the entity by its ID number. More...
 
static EntityFind (name_t entity_name)
 Finds the entity by its name. More...
 

Protected Attributes

Component< RenderComponentrendercomponent
 
Component< PhysicsComponentphysicscomponent
 
name_t model
 
name_t collmodel
 
- Protected Attributes inherited from tram::Entity
id_t id = 0
 
name_t name
 
WorldCellcell = nullptr
 
SignalTablesignals = nullptr
 
quat rotation = {1.0f, 0.0f, 0.0f, 0.0f}
 
vec3 location = {0.0f, 0.0f, 0.0f}
 
uint32_t flags = 0
 

Additional Inherited Members

- Public Types inherited from tram::Entity
enum  : uint32_t { FIELD_SERIALIZE = 1 }
 
- Protected Types inherited from tram::Entity
enum  : uint32_t {
  NON_PERSISTENT = 1 , LOADED = 2 , DISABLE_AUTO_LOAD = 4 , NON_SERIALIZABLE = 8 ,
  DIRTY = 16 , DELETED = 32 , LOADED_FROM_DISK = 64
}
 
- Protected Member Functions inherited from tram::Entity
void Register ()
 Registers the entity. More...
 
void Unregister ()
 Unregisters the entity. More...
 
void FireSignal (signal_t type)
 
void FireSignal (signal_t type, Value value)
 
void SetFlag (uint32_t flag, bool value)
 

Constructor & Destructor Documentation

◆ TriggerHurt()

tram::Ext::Kitchensink::TriggerHurt::TriggerHurt ( const SharedEntityData ,
const ValueArray  
)

Member Function Documentation

◆ Load()

void tram::Ext::Kitchensink::TriggerHurt::Load ( )
virtual

Loads an entity.

Usually the Load() method for an entity type will set up its components, event listeners, etc. After being loaded, the entity will be ready for simulation.

When implementing this method, make sure to flag the entity with the LOADED flag, so that world streaming system doesn't try to load your entity twice.

Implements tram::Entity.

◆ MessageHandler()

void tram::Ext::Kitchensink::TriggerHurt::MessageHandler ( Message msg)
virtual

Allows entities to receive messages.

Whenever an entity is sent a Message, once the Message::Dispatch() function has been called, the entity will gets the message passed to it through this method.

Implements tram::Entity.

◆ Register()

static void tram::Ext::Kitchensink::TriggerHurt::Register ( )
static

◆ Serialize()

void tram::Ext::Kitchensink::TriggerHurt::Serialize ( )
virtual

Implements tram::Entity.

◆ SetParameters()

void tram::Ext::Kitchensink::TriggerHurt::SetParameters ( )
virtual

Called when either Entity::SetLocation or Entity::SetRotation is called.

Usually this method is used to relocate or rerotate an entity.

If the entity has a PhysicsComponent, its position or rotation is usually set from this method, otherwise in the next Physics update step, the entity's previous rotation and location will be restored.

Implements tram::Entity.

◆ Unload()

void tram::Ext::Kitchensink::TriggerHurt::Unload ( )
virtual

Unloads an entity.

Usually the Load() method for an entity type will destroy its its components, event listeners, etc. After being unloaded, the entity have been removed from the simulation.

When implementing this method, make sure to clear your entity's LOADED flag, so that world streaming system can load the entity again.

Implements tram::Entity.

◆ UpdateParameters()

void tram::Ext::Kitchensink::TriggerHurt::UpdateParameters ( )
virtual

Called when Entity::UpdateTransform is called.

From the runtime's side, only the Physics system will call the Entity::UpdateTransform() method, and through it, this method.

Usually this method is used to forward the entity's new position and rotation to its RenderComponent, if it has one.

If the entity has a PhysicsComponent, its position or rotation is never updated from this method.

Implements tram::Entity.

Member Data Documentation

◆ collmodel

name_t tram::Ext::Kitchensink::TriggerHurt::collmodel
protected

◆ model

name_t tram::Ext::Kitchensink::TriggerHurt::model
protected

◆ physicscomponent

Component<PhysicsComponent> tram::Ext::Kitchensink::TriggerHurt::physicscomponent
protected

◆ rendercomponent

Component<RenderComponent> tram::Ext::Kitchensink::TriggerHurt::rendercomponent
protected

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