#include <Entity.h>
Inheritance diagram for ogs::core::Entity:
Public Types | |
typedef double | Weight |
A floating point type that measures the weight of entity. | |
typedef std::pair< int, int > | Health |
A pair of signed integer types that measures the health or condition of entity. | |
Public Member Functions | |
const Size & | getSize () const |
Determine the current size category of this entity. | |
Size & | getSize () |
Determine the current size category of this entity. | |
Weight | getWeight () const |
Determine the current weight of this entity. | |
void | setWeight (Weight weight) |
Change the weight of this entity. | |
const Defense & | getDefense () const |
Determine the current defense rating of this entity. | |
Defense & | getDefense () |
Determine the current defense rating of this entity. | |
Health | getHealth () const |
Determine the health of this entity. | |
void | setHealth (Health health) |
Change the health of this entity. | |
Features | getFeatures () const |
Determine the features attached to this entity. | |
bool | addFeature (Feature &feature) |
Add a feature to this entity. | |
bool | removeFeature (Feature &feature) |
Remove a feature from this entity. | |
Protected Member Functions | |
Entity (Size::Type size=Size::MEDIUM, Weight weight=0.0) | |
Create a new entity. |
Entity
class is an abstract class that contains attributes and operations common to all entities.
|
The first element in the pair is the current health of the entity. The second element is the maximum health. When the current health is equal to the maximum health, the entity is in its best possible condition. A current health value near 0 usually means the entity is nearly destroyed. Health is also referred to as hit points. |
|
The units of measurement for weight are locale dependent. |
|
This constructor is protected so only derived classes can call it. It initializes weight and health attributes to zero (0), size to medium, defense to base (10), with no features. The size modifier is automatically added to defense. So any change in size will automatically be reflected in the defense.
|
|
If the feature is already in the list of features for this entity or the feature cannot be attached to this entity, this function does nothing.
|
|
This function allows the caller to add and remove modifiers to the defense rating for this entity.
|
|
|
|
|
|
|
|
This function allows the caller to change the size of this entity.
|
|
|
|
Units of measurement for weight are locale dependent.
|
|
If the feature cannot be removed from this entity, this function does nothing.
|
|
Observers are notified of this change.
|
|
Units of measurement for weight are locale dependent. Observers are notified of the change.
|