Rally X
ELEN3009 Project by Justin Wernick and David Schneider
|
Class for mapping BitmapStore images to colours for use in the minimap. More...
#include <ColourStore.h>
Public Member Functions | |
ColourStore () | |
Creates the ColourStore object and initialises all of the colours. | |
ALLEGRO_COLOR | getColour (BitmapStore::Image image) |
Returns the colour associated with a given image. | |
Private Member Functions | |
ColourStore (const ColourStore &ref) | |
Unimplemented copy constructor, prevents copying of ColourStore objects. | |
ColourStore & | operator= (const ColourStore &rhs) |
Unimplemented assignment operator. | |
void | populateColours () |
Initialises all of the relevant colours. | |
Private Attributes | |
map< BitmapStore::Image, ALLEGRO_COLOR > | _colours |
ALLEGRO_COLOR | _transparent |
Initialised to have an alpha of 0, and returned when the colour of an unlisted image is requested. |
Class for mapping BitmapStore images to colours for use in the minimap.
Definition at line 14 of file ColourStore.h.
ColourStore::ColourStore | ( | ) |
Creates the ColourStore object and initialises all of the colours.
Definition at line 3 of file ColourStore.cpp.
ColourStore::ColourStore | ( | const ColourStore & | ref | ) | [private] |
Unimplemented copy constructor, prevents copying of ColourStore objects.
Copying a ColourStore is unneccesary as there should only be a single ColourStore object.
ALLEGRO_COLOR ColourStore::getColour | ( | BitmapStore::Image | image | ) |
Returns the colour associated with a given image.
If no colour makes sense for the image, then when it is requested a colour with an alpha of 0 (completely transparent) is returned.
[in] | image | The BitmapStore image to be associated with a colour. |
Definition at line 18 of file ColourStore.cpp.
ColourStore& ColourStore::operator= | ( | const ColourStore & | rhs | ) | [private] |
Unimplemented assignment operator.
void ColourStore::populateColours | ( | ) | [private] |
Initialises all of the relevant colours.
Definition at line 8 of file ColourStore.cpp.
map<BitmapStore::Image, ALLEGRO_COLOR> ColourStore::_colours [private] |
Definition at line 47 of file ColourStore.h.
ALLEGRO_COLOR ColourStore::_transparent [private] |
Initialised to have an alpha of 0, and returned when the colour of an unlisted image is requested.
Definition at line 52 of file ColourStore.h.