#include <bubble_generator.h>
Public Member Functions | |
BubbleGenerator (unsigned numOfDifferentBubbles, Camera *camera) | |
Constructor. | |
~BubbleGenerator () | |
Destructor. | |
Bubble * | generateBubble () const |
Generates a single bubble. | |
Private Types | |
typedef std::vector< Bubble * > | BubbleContainerType |
Container to store bubbles. | |
Private Member Functions | |
BubbleGenerator (const BubbleGenerator &) | |
BubbleGenerator & | operator= (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. |
This class implements bubble generation according to passed parameters.
Reference object (cannot be copied).
typedef std::vector<Bubble *> BubbleGenerator::BubbleContainerType [private] |
Container to store bubbles.
BubbleGenerator::BubbleGenerator | ( | const BubbleGenerator & | ) | [private] |
BubbleGenerator::BubbleGenerator | ( | unsigned | numOfDifferentBubbles, | |
Camera * | camera | |||
) |
Constructor.
[in] | numOfDifferentBubbles | Number of different bubbles that this object can generate. |
[in] | camera | Main camera (needed by some types of explosions). |
BubbleGenerator::~BubbleGenerator | ( | ) |
Destructor.
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.
Available bubbles to be generated.
Camera* BubbleGenerator::_camera [private] |
Main camera.
const unsigned BubbleGenerator::NUMBER_OF_DIFFERENT_BUBBLES [private] |
Number of different bubbles that the generateBubble() method can generate.