Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends

Powerup Class Reference

The base class for powerups. More...

#include <Powerup.h>

Inheritance diagram for Powerup:
PowerupBigHand PowerupJunkPiece PowerupLinePiece PowerupMirror PowerupReverse PowerupShrinkRay PowerupSpeedUp

List of all members.

Public Member Functions

bool Initiate (u8 targetPlayer)
 Initiates this powerup on the target player(s).
void Update ()
 Updates the timer and terminates this powerup if its duration has been exceeded.
virtual PowerupId GetPowerupId ()=0
 The unique PowerupId representing this powerup.
virtual GuiImageData * GetImageData ()=0
 The image associated with this powerup.
virtual string * GetHelpText ()=0
 A description of this powerup used in the menu.
virtual GuiSound * GetSound ()
 The sound associated with this powerup.

Protected Member Functions

virtual PowerupGetInstance ()=0
 Returns a new powerup instance.
virtual void StartEffect (u8 player)=0
 The powerup state change goes here.
virtual void StopEffect (u8 player)=0
 Reverts the state back to normal.
virtual u32 GetDuration ()
 The duration of this powerup, in milliseconds.
virtual PowerupTarget GetTargetType ()
 Determines what players are the target of this powerup.

Static Protected Member Functions

static vector< Powerup * > & GetVector ()
 Returns the global Powerup vector.

Friends

class PowerupUtils

Detailed Description

The base class for powerups.

Definition at line 135 of file Powerup.h.


Member Function Documentation

static vector<Powerup *>& Powerup::GetVector (  )  [inline, static, protected]

Returns the global Powerup vector.

This vector contains a static instance of every Powerup.

Definition at line 176 of file Powerup.h.

bool Powerup::Initiate ( u8  targetPlayer  ) 

Initiates this powerup on the target player(s).

Do not override this function. This function is called automatically whenever a powerup is dropped on a player.

Parameters:
targetPlayer The target player index.
Returns:
True if the powerup was successfully used on a player.

Definition at line 44 of file Powerup.cpp.


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