|
Building Game Engines
|
#include <ResourceManager.hpp>

Public Member Functions | |
| void | Start (SDL_Renderer *m_renderer) |
| void | Shutdown () |
| void | SaveState (const char *name) |
| void | LoadEnemies (const char *filename) |
| void | LoadCollectibles (const char *filename) |
| void | AddGameObject (std::string name, GameObject *object) |
| GameObject * | GetGameObject (std::string name) |
| std::unordered_map< std::string, GameObject * > | GetGameObjects () |
| void | RemoveGameObject (std::string name) |
| void | Input (SDL_Event e) |
| void | PausedInput (SDL_Event e) |
| void | Update () |
| void | PausedUpdate () |
| void | Render (SDL_Renderer *m_renderer) |
| GameObject * | MakeEnemy (int x, int y, int range, int type) |
| GameObject * | MakeFruit (int xpos, int ypos, int width, int height, int type) |
| void | ChangePlaceWhat (int to) |
| void | changeBlock (int valueBlock) |
| ResourceManager () | |
Static Public Member Functions | |
| static ResourceManager * | GetInstance () |
Public Attributes | |
| int | currentTile = 0 |
| SDL_Renderer * | the_renderer |
Manages all the resources in the game
|
inline |
| void ResourceManager::AddGameObject | ( | std::string | name, |
| GameObject * | object | ||
| ) |
Adds a game object
| void ResourceManager::changeBlock | ( | int | valueBlock | ) |
Allows for the gui to edit what brick is being edited
| void ResourceManager::ChangePlaceWhat | ( | int | to | ) |
| GameObject * ResourceManager::GetGameObject | ( | std::string | name | ) |
Gets a game object
| std::unordered_map<std::string, GameObject*> ResourceManager::GetGameObjects | ( | ) |
Gets all game objects
|
static |
Gets the instance of this resource manager (there can only be one)

| void ResourceManager::Input | ( | SDL_Event | e | ) |
Processes input for all game objects
| void ResourceManager::LoadCollectibles | ( | const char * | filename | ) |
Loads collectible information from a file.

| void ResourceManager::LoadEnemies | ( | const char * | filename | ) |
Loads enemy information from a file.

| GameObject * ResourceManager::MakeEnemy | ( | int | x, |
| int | y, | ||
| int | range, | ||
| int | type | ||
| ) |

| GameObject * ResourceManager::MakeFruit | ( | int | xpos, |
| int | ypos, | ||
| int | width, | ||
| int | height, | ||
| int | type | ||
| ) |

| void ResourceManager::PausedInput | ( | SDL_Event | e | ) |
Processes input for the game while it is paused

| void ResourceManager::PausedUpdate | ( | ) |
Updates the games information while paused
| void ResourceManager::RemoveGameObject | ( | std::string | name | ) |
Removes the specified game object
| void ResourceManager::Render | ( | SDL_Renderer * | m_renderer | ) |
Renders all game objects

| void ResourceManager::SaveState | ( | const char * | name | ) |
Makes a save with the given save name

| void ResourceManager::Shutdown | ( | ) |
Shuts down the resource manager by freeing all objects

| void ResourceManager::Start | ( | SDL_Renderer * | m_renderer | ) |
Starts the resource manager by creating all objects

| void ResourceManager::Update | ( | ) |
Updates all game objects

| int ResourceManager::currentTile = 0 |
| SDL_Renderer* ResourceManager::the_renderer |
1.8.13