Hosting courtesy of Sourceforge

SourceForge Logo
Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Game::PowerupFactory Class Reference

#include <Powerup.h>

Inheritance diagram for Game::PowerupFactory:

Inheritance graph
[legend]
Collaboration diagram for Game::PowerupFactory:

Collaboration graph
[legend]
List of all members.

Public Methods

PowerupgetPowerup ()
Parse::ParsermakeParserToParseMe (std::istream &in)

Detailed Description

Randomly allocates powerups. The proability of allocation for each powerup can be set in the map, if it doesn't get set by the map, the probabilities will default to the values given in Constants.h

Definition at line 76 of file Powerup.h.


Constructor & Destructor Documentation

PowerupFactory::PowerupFactory  
 

Definition at line 58 of file Powerup.cpp.


Member Function Documentation

Powerup * PowerupFactory::getPowerup  
 

Dynamically allocate a Powerup based on internal probabilites. Behavior is undefined if the sum of the probabilities is greater than 1, or if any invidiual probability is less than 0. It returns NULL if no powerup is allocated.

Definition at line 64 of file Powerup.cpp.

Parse::Parser * PowerupFactory::makeParserToParseMe std::istream &    in [virtual]
 

All probabilities are in decimal form. IE, 1 out of 5, is .2, not 20. Creates parser with the following identifiers

  1. BombRad - probability of generating a IncreaseBombRadius
  2. BombCount - probablity of generating a IncreaseBombCount
  3. SpeedUp - probabilty of generating a SpeedUp

Reimplemented from Parse::Parseable.

Definition at line 79 of file Powerup.cpp.


The documentation for this class was generated from the following files:
Generated on Tue May 21 07:26:54 2002 for BomberLAN by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001