-
Notifications
You must be signed in to change notification settings - Fork 0
/
MapLoader.h
43 lines (39 loc) · 1.1 KB
/
MapLoader.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
#pragma once
#include <iostream>
#include <fstream>
#include <map>
#include "SimpleSprite.h"
#include "Wall.h"
#include "dxManager.h"
#include "Globals.h"
#include "Checkpoint.h"
#include "Trap.h"
using namespace std;
class MapLoader
{
public:
MapLoader(dxManager* dx, char* mapFileName,char* keyFileName, int rows, int cols, float blockSize);
~MapLoader(void);
float getMapLengthP();
float getMapHeightP();
void getP1Start(float*, float*);
void getP2Start(float*, float*);
Checkpoint* getFinishPoint();
int getNumOfCheckpoints(void);
Checkpoint** checkpointArray; // this will be passed into CheckPointManager
private:
dxManager* dx;
char** mapArray;
map<char, char*> keyList;
static const int NUM_OF_CHECKPOINTS = 10; // used to initalize our checkpoint array
int checkpointCounter;
int mapLength;
int mapHeight;
float gridBlockSize;
float p1StartX, p1StartY, p2StartX, p2StartY;
Checkpoint* finishPoint;
int readMapFile(char* fileName);
int readKeyFile(char* fileName);
void createMap(float topLeftX, float topLeftY);
TCHAR* charToTCHAR(char* myString);
};