ArnieBoids  1.0.0
JOINT AI PROJECT
Pickup Class Reference

Pickup class. A multi-purpose pickup that assists a Player or Predator. A pickup will add as much health as it can, then provide shields based on remaining value. More...

#include <Pickup.hpp>

Inheritance diagram for Pickup:
Collaboration diagram for Pickup:

Public Member Functions

 Pickup (sf::Vector2f const &position, int value)
 
void update ()
 Updates colours, pickup logic, shield timing. More...
 
void take (Ship *taker)
 Affects the taker with pickup's logic. More...
 
bool isActive ()
 
bool isOwned () const
 
ShipgetOwner () const
 
bool wasPickedUpLastTick ()
 Used to play as sound in Game::update() when power up is collected. More...
 

Private Member Functions

void setShape (float radius)
 
float tickToSec (unsigned int ticks) const
 

Private Attributes

Shipowner_
 
bool pickedUp_
 
unsigned int value_
 Value of powerup, in HP. More...
 
unsigned int ticks_
 Ticks passed since spawn. More...
 
unsigned int takeTick_
 The tick number that we were picked up on. More...
 
unsigned int shieldTimeTotal_
 Total shielding time, value_ * 2. More...
 
unsigned int shieldTime_
 Shield time that counts up to total when active. More...
 

Detailed Description

Pickup class. A multi-purpose pickup that assists a Player or Predator. A pickup will add as much health as it can, then provide shields based on remaining value.

Constructor & Destructor Documentation

Pickup::Pickup ( sf::Vector2f const &  position,
int  value 
)

Here is the call graph for this function:

Member Function Documentation

Ship * Pickup::getOwner ( ) const
bool Pickup::isActive ( )
bool Pickup::isOwned ( ) const

Here is the caller graph for this function:

void Pickup::setShape ( float  radius)
private

Here is the caller graph for this function:

void Pickup::take ( Ship taker)

Affects the taker with pickup's logic.

Here is the call graph for this function:

float Pickup::tickToSec ( unsigned int  ticks) const
private

Here is the caller graph for this function:

void Pickup::update ( )

Updates colours, pickup logic, shield timing.

Here is the call graph for this function:

bool Pickup::wasPickedUpLastTick ( )

Used to play as sound in Game::update() when power up is collected.

Here is the call graph for this function:

Member Data Documentation

Ship* Pickup::owner_
private
bool Pickup::pickedUp_
private
unsigned int Pickup::shieldTime_
private

Shield time that counts up to total when active.

unsigned int Pickup::shieldTimeTotal_
private

Total shielding time, value_ * 2.

unsigned int Pickup::takeTick_
private

The tick number that we were picked up on.

unsigned int Pickup::ticks_
private

Ticks passed since spawn.

unsigned int Pickup::value_
private

Value of powerup, in HP.


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