-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLevel.h
executable file
·59 lines (39 loc) · 1.01 KB
/
Level.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
#ifndef LEVEL_H
#define LEVEL_H
#include "RenderManager.h"
#include "Tile.h"
#include "BaseTile.h"
#include "Entity.h"
#include "EntityMoving.h"
#include "Player.h"
#include "TestEntity.h"
typedef std::vector<unsigned int> ENTITY_LIST;
class Level
{
public:
Level( RenderManager* renderManager );
~Level();
template<class T>
void createTile( int texPosX, int texPosY, bool solid, int x, int y )
{
map[ y * width + x ] = new T( texPosX, texPosY, solid, x, y );
}
Tile& getTile( int x, int y );
void loadLevel( Player* player );
void load();
void tick( long dt );
void render();
Player& getPlayer();
private:
std::vector<Tile*> map;
int getHeight( int x );
std::vector<Tile*> getColumn( int x );
long long int playerHiX;
unsigned long long int width;
int height;
RenderManager* renderManager;
EntityManager* entityManager;
Player* player;
ENTITY_LIST entities;
};
#endif // LEVEL_H