Oficina Framework  1.3
Games Framework
OficinaFramework::EntitySystem::Entity Class Referenceabstract

Abstract class representing an entity. More...

#include <EntitySystem.hpp>

Inheritance diagram for OficinaFramework::EntitySystem::Entity:
OficinaFramework::EntitySystem::DrawableEntity

Public Member Functions

virtual ~Entity ()
 Destructor for the entity. More...
 
virtual void Initialize ()=0
 Initializes the logic of the entity. More...
 
virtual void Update ()=0
 Updates the entity on runtime. More...
 
vec2 GetPosition () const
 Gets the position of the entity. More...
 
void SetPosition (vec2 Position)
 Sets the position of the entity. More...
 
float GetAngle () const
 Gets the angle of the entity. More...
 
void SetAngle (float Angle)
 Sets the angle of the entity. More...
 
std::string GetName () const
 Gets the name of the entity. More...
 
void SetName (std::string name)
 Sets the name of the entity. More...
 
bool GetProperty (byte ID) const
 Gets the state of a single property on the properties mask. More...
 
void SetProperty (byte ID, bool state)
 Sets the state of a single property on the properties mask. More...
 
qword GetProperties () const
 Gets the whole properties mask of the entity. More...
 
void SetProperties (qword newmask)
 Sets the whole properties mask of the entity. More...
 
EntityCollectionGetParent ()
 Gets entity collection that manages this entity. More...
 
void SetParent (EntityCollection *ec)
 Sets a pointer to the entity collection that manages this entity. More...
 
bool IsMarkedForRemoval ()
 Gets if the current entity is marked for removal. More...
 
void RemoveMe ()
 Marks the current entity for removal. More...
 

Protected Attributes

std::string m_name
 Name of the entity. More...
 
vec2 m_position
 Position of the entity, as per Gongly Script standard (2014). More...
 
float m_angle = 0.0f
 Angle of the entity, as per Gongly Script standard (2014). More...
 
qword m_properties = 0x0000000000000000u
 A set of 64 boolean properties fo the entity, as per Gongly Script standard (2014). More...
 

Detailed Description

Abstract class representing an entity.

Constructor & Destructor Documentation

◆ ~Entity()

virtual OficinaFramework::EntitySystem::Entity::~Entity ( )
inlinevirtual

Member Function Documentation

◆ GetAngle()

float OficinaFramework::EntitySystem::Entity::GetAngle ( ) const

Gets the angle of the entity.

Returns
Current angle of the entity.

◆ GetName()

std::string OficinaFramework::EntitySystem::Entity::GetName ( ) const

Gets the name of the entity.

Returns
Entity name.

◆ GetParent()

EntityCollection* OficinaFramework::EntitySystem::Entity::GetParent ( )

Gets entity collection that manages this entity.

Returns
A pointer to the entity collection that manages this entity.

◆ GetPosition()

vec2 OficinaFramework::EntitySystem::Entity::GetPosition ( ) const

Gets the position of the entity.

Returns
Current position of the entity.

◆ GetProperties()

qword OficinaFramework::EntitySystem::Entity::GetProperties ( ) const

Gets the whole properties mask of the entity.

Returns
The actual properties mask.

◆ GetProperty()

bool OficinaFramework::EntitySystem::Entity::GetProperty ( byte  ID) const

Gets the state of a single property on the properties mask.

Parameters
IDID ranged 0~63 of the actual property.
Returns
The actual property state.
Warning
Giving and ID beyond 63 will always return false.

◆ Initialize()

virtual void OficinaFramework::EntitySystem::Entity::Initialize ( )
pure virtual

Initializes the logic of the entity.

Implemented in OficinaFramework::EntitySystem::DrawableEntity.

◆ IsMarkedForRemoval()

bool OficinaFramework::EntitySystem::Entity::IsMarkedForRemoval ( )

Gets if the current entity is marked for removal.

Returns
Whether the entity is marked for removal or not.
Warning
If the entity is on a collection, it will be removed on the collection's next update call.

◆ RemoveMe()

void OficinaFramework::EntitySystem::Entity::RemoveMe ( )

Marks the current entity for removal.

Warning
If the entity is on a collection, it will be removed on the collection's next update call.

◆ SetAngle()

void OficinaFramework::EntitySystem::Entity::SetAngle ( float  Angle)

Sets the angle of the entity.

Parameters
AngleAngle to be given to the entity.

◆ SetName()

void OficinaFramework::EntitySystem::Entity::SetName ( std::string  name)

Sets the name of the entity.

Parameters
nameName to be given to the entity.

◆ SetParent()

void OficinaFramework::EntitySystem::Entity::SetParent ( EntityCollection ec)

Sets a pointer to the entity collection that manages this entity.

Parameters
ecEntityCollection that manages this entity.
Attention
This method is automatically used when adding the entity to a collection. Use at your own risk.

◆ SetPosition()

void OficinaFramework::EntitySystem::Entity::SetPosition ( vec2  Position)

Sets the position of the entity.

Parameters
PositionPosition to be given to the entity.

◆ SetProperties()

void OficinaFramework::EntitySystem::Entity::SetProperties ( qword  newmask)

Sets the whole properties mask of the entity.

Parameters
newmaskMask to replace the properties mask for.
Warning
Use this carefully! You might mess up with your entities' properties.

◆ SetProperty()

void OficinaFramework::EntitySystem::Entity::SetProperty ( byte  ID,
bool  state 
)

Sets the state of a single property on the properties mask.

Parameters
IDID ranged 0~63 of the actual property.
stateDesired state of the property to be set.
Warning
Giving and ID beyond 63 will have no effect.

◆ Update()

virtual void OficinaFramework::EntitySystem::Entity::Update ( )
pure virtual

Updates the entity on runtime.

Implemented in OficinaFramework::EntitySystem::DrawableEntity.

Member Data Documentation

◆ m_angle

float OficinaFramework::EntitySystem::Entity::m_angle = 0.0f
protected

Angle of the entity, as per Gongly Script standard (2014).

◆ m_name

std::string OficinaFramework::EntitySystem::Entity::m_name
protected

Name of the entity.

◆ m_position

vec2 OficinaFramework::EntitySystem::Entity::m_position
protected

Position of the entity, as per Gongly Script standard (2014).

◆ m_properties

qword OficinaFramework::EntitySystem::Entity::m_properties = 0x0000000000000000u
protected

A set of 64 boolean properties fo the entity, as per Gongly Script standard (2014).


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