Thrive
Public Member Functions | Static Public Member Functions | Friends | List of all members
thrive::PowerupComponent Class Reference

Component for entities that work as powerups. More...

#include <powerup_system.h>

Inheritance diagram for thrive::PowerupComponent:
thrive::Component

Public Member Functions

void setEffect (std::function< bool(EntityId)> *effect)
 Sets the effect to use upon activation of the powerup. More...
 
void setEffect (const luabind::object &effect)
 Sets the effect to use upon activation of the powerup The effect does not get saved when the game is saved. More...
 
void load (const StorageContainer &storage) override
 Loads the component. More...
 
StorageContainer storage () const override
 Serializes the component. More...
 
- Public Member Functions inherited from thrive::Component
virtual ~Component ()=0
 Destructor.
 
bool isVolatile () const
 A volatile component is not serialized during a save. More...
 
EntityId owner () const
 The entity this component belongs to. More...
 
void setVolatile (bool isVolatile)
 Sets the volatile flag. More...
 
void setOwner (EntityId owner)
 Sets the component's owner. More...
 
virtual ComponentTypeId typeId () const =0
 The component's type id.
 
virtual std::string typeName () const =0
 The component's type name.
 

Static Public Member Functions

static luabind::scope luaBindings ()
 Lua bindings. More...
 
- Static Public Member Functions inherited from thrive::Component
static luabind::scope luaBindings ()
 Lua bindings. More...
 

Friends

class PowerupSystem
 

Detailed Description

Component for entities that work as powerups.

Member Function Documentation

void PowerupComponent::load ( const StorageContainer &  storage)
overridevirtual

Loads the component.

Parameters
storage

Implements thrive::Component.

luabind::scope PowerupComponent::luaBindings ( )
static

Lua bindings.

Exposes:

Returns
void PowerupComponent::setEffect ( std::function< bool(EntityId)> *  effect)

Sets the effect to use upon activation of the powerup.

Parameters
effectFunction taking the entityId of the activating entity.
void PowerupComponent::setEffect ( const luabind::object &  effect)

Sets the effect to use upon activation of the powerup The effect does not get saved when the game is saved.

Parameters
effectLua function taking the entityId of the activating entity.
StorageContainer PowerupComponent::storage ( ) const
overridevirtual

Serializes the component.

Returns

Implements thrive::Component.


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