Jamie Slowgrove - PGG Assignment 1 - SDL
 All Classes Functions
Classes | Public Member Functions | List of all members
MapLoader Class Reference

a class to load in a map text file More...

#include <mapLoader.h>

Collaboration diagram for MapLoader:
Collaboration graph

Public Member Functions

 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 ()
 
BlockgetBlock (int)
 
GemgetGem (int)
 
EnemygetEnemy (int)
 
int getNumberOfEntities ()
 
int getNumberOfRows ()
 
char getType (int, int)
 
int getIndex (int, int)
 
void setEntityBlank (int, int)
 

Detailed Description

a class to load in a map text file

Constructor & Destructor Documentation

MapLoader::MapLoader ( std::string  fileName,
Texture inTexture,
int  backgroundType 
)

Constructs MapLoader object Constructs a MapLoader object.

Parameters
std::stringthe file location
Texture* a pointer to the spritesheet
intthe type of background

Here is the call graph for this function:

MapLoader::~MapLoader ( )

De-constructs a MapLoader object De-constructs the MapLoader object

Member Function Documentation

void MapLoader::displayBlock ( int  i,
SDL_Renderer *  renderer 
)

display the Block object display the Block at the position at the array inputed

Parameters
intthe index of the Block array
SDL_Renderer* a pointer to the renderer

Here is the caller graph for this function:

void MapLoader::displayEnemy ( int  i,
SDL_Renderer *  renderer 
)

display the Enemy object display the Enemy at the position at the array inputed

Parameters
intthe index of the Enemy array
SDL_Renderer* a pointer to the renderer

Here is the caller graph for this function:

void MapLoader::displayGem ( int  i,
SDL_Renderer *  renderer 
)

display the Gem object display the Gem at the position at the array inputed

Parameters
intthe index of the Gem array
SDL_Renderer* a pointer to the renderer

Here is the caller graph for this function:

Block * MapLoader::getBlock ( int  i)

Getter # a Block from the array

Parameters
intthe index of the block
Returns
a pointer to a Block.

Here is the caller graph for this function:

Enemy * MapLoader::getEnemy ( int  i)

Getter # a Enemy from the array

Parameters
intthe index of the Enemy
Returns
a pointer to a Enemy.

Here is the caller graph for this function:

Gem * MapLoader::getGem ( int  i)

Getter # a Block from the array

Parameters
intthe index of the Block
Returns
a pointer to a Block.

Here is the caller graph for this function:

int MapLoader::getIndex ( int  i,
int  j 
)

Getter # the index of the type array

Parameters
inti index
intj index
Returns
the type of the index in the types array.

Here is the caller graph for this function:

int MapLoader::getNumberOfBlocks ( )

Getter # number of blocks

Returns
the number of blocks.

Here is the caller graph for this function:

int MapLoader::getNumberOfEnemies ( )

Getter # height

Returns
the number of enemies.

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

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
inti index
intj index
Returns
the type of the position in the array.

Here is the caller graph for this function:

void MapLoader::loadMap ( std::string  fileName,
int  backgroundType 
)

load the map file load the map file from the location passed in.

Parameters
std::stringthe file location
intthe type of background

Here is the call graph for this function:

Here is the caller graph for this function:

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
inti index
intj index

Here is the caller graph for this function:

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
intthe type of the object
intthe i index for the x position
intthe j index for the y position
intthe type of background

Here is the caller graph for this function:


The documentation for this class was generated from the following files: