|
R-Type
Distributed multiplayer game engine in C++
|
Component for items that can be picked up by players. More...
#include <Collectible.hpp>


Public Member Functions | |
| Collectible (BuffType buffType, float duration, float value) | |
| Constructor for buff-granting collectible. | |
| Collectible (int healthRestore) | |
| Constructor for health pack. | |
| Collectible (int scoreValue, bool isScoreType) | |
| Constructor for score pickup. | |
| ~Collectible () override=default | |
| CollectibleType | getCollectibleType () const |
| Get collectible type. | |
| BuffType | getBuffType () const |
| Get buff type (if applicable) | |
| float | getDuration () const |
| Get buff duration. | |
| float | getValue () const |
| Get buff value. | |
| int | getHealthRestore () const |
| Get health restore amount. | |
| int | getScoreValue () const |
| Get score value. | |
| bool | grantsBuff () const |
| Check if this grants a buff. | |
| bool | restoresHealth () const |
| Check if this restores health. | |
| bool | awardsScore () const |
| Check if this awards score. | |
| ComponentType | getType () const override |
| Get the component type ID. | |
Public Member Functions inherited from ecs::IComponent | |
| virtual | ~IComponent ()=default |
| Virtual destructor. | |
Private Attributes | |
| CollectibleType | _type |
| Type of collectible. | |
| BuffType | _buffType |
| Buff granted (if applicable) | |
| float | _duration |
| Buff duration. | |
| float | _value |
| Buff value. | |
| int | _healthRestore |
| Health restored (if health pack) | |
| int | _scoreValue |
| Score points (if score pickup) | |
Component for items that can be picked up by players.
Defines pickup items with their effects when collected. Can grant buffs, restore health, or award points.
Definition at line 33 of file Collectible.hpp.
|
inline |
Constructor for buff-granting collectible.
| buffType | Type of buff to grant |
| duration | Duration of buff (0.0f for permanent) |
| value | Buff value/multiplier |
Definition at line 41 of file Collectible.hpp.
|
inlineexplicit |
Constructor for health pack.
| healthRestore | Amount of health to restore |
Definition at line 53 of file Collectible.hpp.
|
inline |
Constructor for score pickup.
| scoreValue | Score points awarded |
| isScoreType | Dummy parameter to differentiate from health constructor |
Definition at line 66 of file Collectible.hpp.
|
overridedefault |
|
inline |
Check if this awards score.
Definition at line 132 of file Collectible.hpp.
References _type, and ecs::Score.
Referenced by ecs::CollisionSystem::handlePickup().
|
inline |
Get buff type (if applicable)
Definition at line 88 of file Collectible.hpp.
References _buffType.
Referenced by ecs::CollisionSystem::handlePickup().
|
inline |
Get collectible type.
Definition at line 82 of file Collectible.hpp.
References _type.
|
inline |
Get buff duration.
Definition at line 94 of file Collectible.hpp.
References _duration.
Referenced by ecs::CollisionSystem::handlePickup().
|
inline |
Get health restore amount.
Definition at line 106 of file Collectible.hpp.
References _healthRestore.
Referenced by ecs::CollisionSystem::handlePickup().
|
inline |
Get score value.
Definition at line 112 of file Collectible.hpp.
References _scoreValue.
Referenced by ecs::CollisionSystem::handlePickup().
|
inlineoverridevirtual |
Get the component type ID.
Implements ecs::IComponent.
Definition at line 138 of file Collectible.hpp.
|
inline |
Get buff value.
Definition at line 100 of file Collectible.hpp.
References _value.
Referenced by ecs::CollisionSystem::handlePickup().
|
inline |
Check if this grants a buff.
Definition at line 118 of file Collectible.hpp.
References _type, ecs::PowerUp, and ecs::Upgrade.
Referenced by ecs::CollisionSystem::handlePickup().
|
inline |
Check if this restores health.
Definition at line 126 of file Collectible.hpp.
References _type, and ecs::HealthPack.
Referenced by ecs::CollisionSystem::handlePickup().
|
private |
Buff granted (if applicable)
Definition at line 142 of file Collectible.hpp.
Referenced by getBuffType().
|
private |
|
private |
Health restored (if health pack)
Definition at line 145 of file Collectible.hpp.
Referenced by getHealthRestore().
|
private |
Score points (if score pickup)
Definition at line 146 of file Collectible.hpp.
Referenced by getScoreValue().
|
private |
Type of collectible.
Definition at line 141 of file Collectible.hpp.
Referenced by awardsScore(), getCollectibleType(), grantsBuff(), and restoresHealth().
|
private |