Jamie Slowgrove - AI Assignment 1
Line of Sight & A* path-finding
 All Classes Namespaces Files Functions Variables
map.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 #include <string>
5 #include <fstream>
6 #include <iostream>
7 #include "texture.h"
8 #include "wall.h"
9 
13 class Map
14 {
15 private:
19  struct id
20  {
21  /*The type of the Entity - x = Blank, w = Wall*/
22  char type;
23  /*The index of the Entity within its array*/
24  int index;
25 
32  id(char inType, int inIndex)
33  {
34  type = inType;
35  index = inIndex;
36  }
37  };
38 
40  std::vector<std::vector<id*>> map;
42  std::vector<Wall*> walls;
43  /*Vec2 positions of the Creature starts*/
45  /*A pointer to the spritesheet Texture*/
47 
52  void loadMap(std::string);
53 
54 public:
60  Map(Texture*, std::string);
61 
65  ~Map();
66 
74  int getMapPositionIndex(int, int);
75 
83  char getMapPositionType(int, int);
84 
91  Wall* getWall(int);
92 
97  int getNumberOfWalls();
98 
103  int getNumberOfXObjects();
104 
109  int getNumberOfYObjects();
110 
116 
122 
128 };
Vec2 getInitialBotB()
Definition: map.cpp:195
Texture * spritesheet
Definition: map.h:46
std::vector< std::vector< id * > > map
Definition: map.h:40
char type
Definition: map.h:22
Creates a Vec2 structure with functions Creates a Vec2 structure with overloaded operators to create ...
Definition: vec2.h:7
void loadMap(std::string)
Definition: map.cpp:36
Definition: map.h:19
Vec2 getInitialPlayer()
Definition: map.cpp:177
id(char inType, int inIndex)
Definition: map.h:32
~Map()
Definition: map.cpp:17
int getNumberOfXObjects()
Definition: map.cpp:159
int getNumberOfWalls()
Definition: map.cpp:150
Vec2 getInitialBotA()
Definition: map.cpp:186
Creates a Wall object that inherits Entity. Creates a Wall object that inherits Entity and contains t...
Definition: wall.h:12
Creates a Map object.
Definition: map.h:13
std::vector< Wall * > walls
Definition: map.h:42
Creates a Texture for use with a renderer Creates a Texture from an image file, this can then be used...
Definition: texture.h:13
int getMapPositionIndex(int, int)
Definition: map.cpp:123
int index
Definition: map.h:24
Map(Texture *, std::string)
Definition: map.cpp:6
Vec2 botB
Definition: map.h:44
int getNumberOfYObjects()
Definition: map.cpp:168
Wall * getWall(int)
Definition: map.cpp:141
Vec2 botA
Definition: map.h:44
Vec2 player
Definition: map.h:44
char getMapPositionType(int, int)
Definition: map.cpp:132