a class to load in a map text file
More...
#include <mapLoader.h>
|
| | MapLoader (std::string, Texture *, int) |
| |
| | ~MapLoader () |
| |
| void | loadMap (std::string, int) |
| |
| void | sortType (int, int, int, int) |
| |
| void | displayBlock (int, SDL_Renderer *) |
| |
| void | displayGem (int, SDL_Renderer *) |
| |
| void | displayEnemy (int, SDL_Renderer *) |
| |
| int | getNumberOfBlocks () |
| |
| int | getNumberOfGems () |
| |
| int | getNumberOfEnemies () |
| |
| Block * | getBlock (int) |
| |
| Gem * | getGem (int) |
| |
| Enemy * | getEnemy (int) |
| |
| int | getNumberOfEntities () |
| |
| int | getNumberOfRows () |
| |
| char | getType (int, int) |
| |
| int | getIndex (int, int) |
| |
| void | setEntityBlank (int, int) |
| |
a class to load in a map text file
| MapLoader::MapLoader |
( |
std::string |
fileName, |
|
|
Texture * |
inTexture, |
|
|
int |
backgroundType |
|
) |
| |
Constructs MapLoader object Constructs a MapLoader object.
- Parameters
-
| std::string | the file location |
| Texture | * a pointer to the spritesheet |
| int | the type of background |
| MapLoader::~MapLoader |
( |
| ) |
|
| void MapLoader::displayBlock |
( |
int |
i, |
|
|
SDL_Renderer * |
renderer |
|
) |
| |
display the Block object display the Block at the position at the array inputed
- Parameters
-
| int | the index of the Block array |
| SDL_Renderer | * a pointer to the renderer |
| void MapLoader::displayEnemy |
( |
int |
i, |
|
|
SDL_Renderer * |
renderer |
|
) |
| |
display the Enemy object display the Enemy at the position at the array inputed
- Parameters
-
| int | the index of the Enemy array |
| SDL_Renderer | * a pointer to the renderer |
| void MapLoader::displayGem |
( |
int |
i, |
|
|
SDL_Renderer * |
renderer |
|
) |
| |
display the Gem object display the Gem at the position at the array inputed
- Parameters
-
| int | the index of the Gem array |
| SDL_Renderer | * a pointer to the renderer |
| Block * MapLoader::getBlock |
( |
int |
i | ) |
|
Getter # a Block from the array
- Parameters
-
| int | the index of the block |
- Returns
- a pointer to a Block.
| Enemy * MapLoader::getEnemy |
( |
int |
i | ) |
|
Getter # a Enemy from the array
- Parameters
-
| int | the index of the Enemy |
- Returns
- a pointer to a Enemy.
| Gem * MapLoader::getGem |
( |
int |
i | ) |
|
Getter # a Block from the array
- Parameters
-
| int | the index of the Block |
- Returns
- a pointer to a Block.
| int MapLoader::getIndex |
( |
int |
i, |
|
|
int |
j |
|
) |
| |
Getter # the index of the type array
- Parameters
-
- Returns
- the type of the index in the types array.
| int MapLoader::getNumberOfBlocks |
( |
| ) |
|
Getter # number of blocks
- Returns
- the number of blocks.
| int MapLoader::getNumberOfEnemies |
( |
| ) |
|
Getter # height
- Returns
- the number of enemies.
| int MapLoader::getNumberOfEntities |
( |
| ) |
|
Getter # number of Entities in a row
- Returns
- the number of Entities in a row.
| int MapLoader::getNumberOfGems |
( |
| ) |
|
Getter # height
- Returns
- the number of gems.
| int MapLoader::getNumberOfRows |
( |
| ) |
|
Getter # number of rows
- Returns
- the number of rows.
| char MapLoader::getType |
( |
int |
i, |
|
|
int |
j |
|
) |
| |
Getter # the type of the array
- Parameters
-
- Returns
- the type of the position in the array.
| void MapLoader::loadMap |
( |
std::string |
fileName, |
|
|
int |
backgroundType |
|
) |
| |
load the map file load the map file from the location passed in.
- Parameters
-
| std::string | the file location |
| int | the type of background |
| void MapLoader::setEntityBlank |
( |
int |
i, |
|
|
int |
j |
|
) |
| |
Setter # the contents at the position to blank Sets the content at the [i][j] position in the array to be a empty tile
- Parameters
-
| void MapLoader::sortType |
( |
int |
type, |
|
|
int |
i, |
|
|
int |
j, |
|
|
int |
backgroundType |
|
) |
| |
sort the map file object types take in the value of the current loaded type and declare the current map object to its correct type.
- Parameters
-
| int | the type of the object |
| int | the i index for the x position |
| int | the j index for the y position |
| int | the type of background |
The documentation for this class was generated from the following files:
- PGGAssignment1SDL/mapLoader.h
- PGGAssignment1SDL/mapLoader.cpp