Rally X
ELEN3009 Project by Justin Wernick and David Schneider
Public Member Functions | Private Member Functions | Private Attributes
ColourStore Class Reference

Class for mapping BitmapStore images to colours for use in the minimap. More...

#include <ColourStore.h>

List of all members.

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.
ColourStoreoperator= (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.

Detailed Description

Class for mapping BitmapStore images to colours for use in the minimap.

Author:
Justin Wernick
David Schneider

Definition at line 14 of file ColourStore.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Parameters:
[in]imageThe BitmapStore image to be associated with a colour.
Returns:
The requested colour.

Definition at line 18 of file ColourStore.cpp.

ColourStore& ColourStore::operator= ( const ColourStore rhs) [private]

Unimplemented assignment operator.

See also:
ColourStore(const ColourStore& ref);
void ColourStore::populateColours ( ) [private]

Initialises all of the relevant colours.

Definition at line 8 of file ColourStore.cpp.


Member Data Documentation

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.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator