Potato Engine
Loading...
Searching...
No Matches
Entity Class Reference

Character with player-like attributes. More...

#include <Entity.hpp>

Inheritance diagram for Entity:
Actor Archivable Tickable Player

Public Member Functions

float TakeDamage (float damage)
 Delivers damage to the entity.
float AddHealth (float amount)
 Adds health to entity.
float GetHealth () const
 Gets health.
Public Member Functions inherited from Actor
 Actor ()
 Constructs actor object.
Vector2 GetPosition () const
 Gets position.
void SetPosition (const Vector2 &position)
 Sets position.
Vector2 GetSize () const
 Gets size.
void SetSize (const Vector2 &size)
 Sets size.
float GetRotation () const
 Gets rotation.
void SetRotation (float rotation)
 Sets rotation.
void AddLocalOffset (const Vector2 &offset)
 Adds to location vector.
void AddLocalRotation (float rotation)
 Adds to rotation value.
bool isVisible () const
 Checks if actor visible.
void SetVisibility (bool visibility)
 Sets visibility of actor.
void DispatchBeginPlay ()
 Internal function used to queue BeginPlay() on actor.
Public Member Functions inherited from Tickable
bool isTicking () const
 Checks if object is ticking.
void SetTicking (bool isEnabled)
 Sets tick state for object.

Protected Attributes

float Health
float MaxHealth

Additional Inherited Members

Public Attributes inherited from Actor
char Texture
Protected Member Functions inherited from Actor
virtual void BeginPlay ()
 Gameplay start.
virtual void Tick (float dt) override
 Update tick event.

Detailed Description

Character with player-like attributes.

Definition at line 9 of file Entity.hpp.

Constructor & Destructor Documentation

◆ Entity()

Entity::Entity ( )

Definition at line 7 of file Entity.cpp.

◆ ~Entity()

Entity::~Entity ( )
virtual

Definition at line 11 of file Entity.cpp.

Member Function Documentation

◆ TakeDamage()

float Entity::TakeDamage ( float damage)

Delivers damage to the entity.

Parameters
damageDamage to deliver
Returns
Health after damage (>= 0)

Definition at line 15 of file Entity.cpp.

◆ AddHealth()

float Entity::AddHealth ( float amount)

Adds health to entity.

Parameters
amountAmount of health to add
Returns
Health after addition

Definition at line 20 of file Entity.cpp.

◆ GetHealth()

float Entity::GetHealth ( ) const

Gets health.

Returns
Health of entity

Definition at line 25 of file Entity.cpp.

Member Data Documentation

◆ Health

float Entity::Health
protected

Definition at line 37 of file Entity.hpp.

◆ MaxHealth

float Entity::MaxHealth
protected

Definition at line 38 of file Entity.hpp.