BubbleGenerator Class Reference

Bubble generator. More...

#include <bubble_generator.h>

List of all members.

Public Member Functions

 BubbleGenerator (unsigned numOfDifferentBubbles, Camera *camera)
 Constructor.
 ~BubbleGenerator ()
 Destructor.
BubblegenerateBubble () const
 Generates a single bubble.

Private Types

typedef std::vector< Bubble * > BubbleContainerType
 Container to store bubbles.

Private Member Functions

 BubbleGenerator (const BubbleGenerator &)
BubbleGeneratoroperator= (const BubbleGenerator &)
void generateAvailableBubbles ()
 Generates all available bubbles and stores them into _availableBubbles.
unsigned getRandomIndex () const
 Returns random index to the _availableBubbles container.

Private Attributes

BubbleContainerType _availableBubbles
 Available bubbles to be generated.
Camera_camera
 Main camera.
const unsigned NUMBER_OF_DIFFERENT_BUBBLES
 Number of different bubbles that the generateBubble() method can generate.


Detailed Description

Bubble generator.

This class implements bubble generation according to passed parameters.

Reference object (cannot be copied).


Member Typedef Documentation

typedef std::vector<Bubble *> BubbleGenerator::BubbleContainerType [private]

Container to store bubbles.


Constructor & Destructor Documentation

BubbleGenerator::BubbleGenerator ( const BubbleGenerator  )  [private]

BubbleGenerator::BubbleGenerator ( unsigned  numOfDifferentBubbles,
Camera camera 
)

Constructor.

Parameters:
[in] numOfDifferentBubbles Number of different bubbles that this object can generate.
[in] camera Main camera (needed by some types of explosions).

BubbleGenerator::~BubbleGenerator (  ) 

Destructor.


Member Function Documentation

BubbleGenerator& BubbleGenerator::operator= ( const BubbleGenerator  )  [private]

void BubbleGenerator::generateAvailableBubbles (  )  [private]

Generates all available bubbles and stores them into _availableBubbles.

unsigned BubbleGenerator::getRandomIndex (  )  const [private]

Returns random index to the _availableBubbles container.

0 <= getRandomIndex() < NUMBER_OF_DIFFERENT_BUBBLES

Bubble* BubbleGenerator::generateBubble (  )  const

Generates a single bubble.

Returns:
Created bubble. If there are no bubbles available, returns null pointer.
Generate bubble is allocated on the heap so it have to be deleted manually.


Member Data Documentation

Available bubbles to be generated.

Main camera.

Number of different bubbles that the generateBubble() method can generate.


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

Generated on Sat Dec 20 19:21:24 2008 for PGR2008 by  doxygen 1.5.6