![]() |
Dragonfly 2.2
A text-based game engine
|
Public Member Functions | |
int | loadSprite (string filename, string label) |
Load Sprite from file. | |
int | unloadSprite (string label) |
Unload Sprite with indicated label. | |
Sprite * | getSprite (string label) |
Find Sprite with indicated label. | |
int | startUp () |
Startup the Manager. | |
void | shutDown () |
Shutdown the Manager. | |
Static Public Member Functions | |
static ResourceManager & | getInstance () |
Get the one and only instance of the ResourceManager. | |
Protected Attributes | |
Sprite * | sprite [MAX_SPRITES] |
Array of sprites. | |
int | sprite_count |
Count of number of loaded sprites. | |
Private Member Functions | |
ResourceManager (ResourceManager const &) | |
Don't allow copy. | |
void | operator= (ResourceManager const &) |
Don't allow assignment. | |
ResourceManager () | |
Private since a singleton. |
Sprite* ResourceManager::getSprite | ( | string | label | ) |
Find Sprite with indicated label.
Return pointer to it if found, else NULL.
int ResourceManager::loadSprite | ( | string | filename, |
string | label | ||
) |
Load Sprite from file.
Assign the indicated label to sprite. Return 0 if ok, else -1.
int ResourceManager::startUp | ( | ) | [virtual] |
int ResourceManager::unloadSprite | ( | string | label | ) |
Unload Sprite with indicated label.
Return 0 if ok, else -1.