-
Notifications
You must be signed in to change notification settings - Fork 0
/
Map.h
61 lines (49 loc) · 1.05 KB
/
Map.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#pragma once
#include "Item.h"
#include "Crate.h"
#include "EndPoint.h"
#include "Grass.h"
#include "Wall.h"
#include "Player.h"
#include "Ground.h"
#include "Directions.h"
class Game;
struct Coords {
int x;
int y;
};
class Map {
public:
Map(int ID, Game* game_);
~Map();
Coords itemToMapCoords(int itemX, int itemY);
void drawMap();
// doesn't put any items inside
void allocateItemMap();
int getIDSize();
char* getMapPath();
bool loadMap();
void drawPlayer();
Player* getPlayer();
Item* getItem(int x, int y);
int getMapHeight();
int getMapWidth();
int getID();
void moveCrate(Item* crate, Directions dir);
int getNumberOfCrates();
int getCratesOnPosition();
private:
// used for switching through maps
int mapID;
const int SPRITE_SIZE = 32;
// map sizes
int mapWidth = 0, mapHeight = 0;
// number of crates on map
// (also endpoints)
int numberOfCrates = 0;
// crates on correct position
int cratesOnPosition = 0;
Item*** itemMap;
Player* player;
Game* selfGame_;
};