Jamie Slowgrove - AI Assignment 1
Line of Sight & A* path-finding
 All Classes Namespaces Files Functions Variables
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Map Class Reference

Creates a Map object. More...

#include <map.h>

Collaboration diagram for Map:
Collaboration graph

Classes

struct  id
 

Public Member Functions

 Map (Texture *, std::string)
 
 ~Map ()
 
int getMapPositionIndex (int, int)
 
char getMapPositionType (int, int)
 
Wall * getWall (int)
 
int getNumberOfWalls ()
 
int getNumberOfXObjects ()
 
int getNumberOfYObjects ()
 
Vec2 getInitialPlayer ()
 
Vec2 getInitialBotA ()
 
Vec2 getInitialBotB ()
 

Private Member Functions

void loadMap (std::string)
 

Private Attributes

std::vector< std::vector< id * > > map
 
std::vector< Wall * > walls
 
Vec2 player
 
Vec2 botA
 
Vec2 botB
 
Texture * spritesheet
 

Detailed Description

Creates a Map object.

Constructor & Destructor Documentation

Map::Map ( Texture *  inSheet,
std::string  fileName 
)

Constructs a Map object

Parameters
Texture*A pointer to the spritesheet Texture
std::stringThe file location

Here is the call graph for this function:

Map::~Map ( )

Destructs a Map object

Member Function Documentation

Vec2 Map::getInitialBotA ( )

Getter # Gets the initial BotA position

Returns
Vec2 The initial BotA position

Here is the caller graph for this function:

Vec2 Map::getInitialBotB ( )

Getter # Gets the initial BotB position

Returns
Vec2 The initial BotB position

Here is the caller graph for this function:

Vec2 Map::getInitialPlayer ( )

Getter # Gets the initial Player position

Returns
Vec2 The initial Player position

Here is the caller graph for this function:

int Map::getMapPositionIndex ( int  x,
int  y 
)

Getter # Gets the index Gets the index stored in the Map at the given position

Parameters
intThe x index of the map
intThe y index of the map
Returns
int The index

Here is the caller graph for this function:

char Map::getMapPositionType ( int  x,
int  y 
)

Getter # Gets the type Gets the type stored in the Map at the given position

Parameters
intThe x index of the map
intThe y index of the map
Returns
char The type

Here is the caller graph for this function:

int Map::getNumberOfWalls ( )

Getter # Gets the number of Wall objects

Returns
int The number of Wall objects

Here is the caller graph for this function:

int Map::getNumberOfXObjects ( )

Getter # Gets the number of x objects (in a row of the map)

Returns
int The number of x objects (in a row of the map)

Here is the caller graph for this function:

int Map::getNumberOfYObjects ( )

Getter # Gets the number of y objects (rows of the map)

Returns
int The number of y objects (rows of the map)

Here is the caller graph for this function:

Wall * Map::getWall ( int  i)

Getter # Gets the Wall Gets the Wall stored in the array at the given index

Parameters
intThe index of the Wall
Returns
Wall * A pointer to the Wall

Here is the caller graph for this function:

void Map::loadMap ( std::string  fileName)
private

Loads the Map

Parameters
std::stringThe file location

Here is the caller graph for this function:

Member Data Documentation

Vec2 Map::botA
private
Vec2 Map::botB
private
std::vector<std::vector<id*> > Map::map
private

2D Map of Entity objects

Vec2 Map::player
private
Texture* Map::spritesheet
private
std::vector<Wall*> Map::walls
private

Entity pointers


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