dungeon_crawler

view prototype/src/level.h @ 1:96de911d05d4

started a rough prototype
author John Tsiombikas <nuclear@mutantstargoat.com>
date Thu, 28 Jun 2012 06:05:50 +0300
parents
children 252a00508411
line source
1 #ifndef LEVEL_H_
2 #define LEVEL_H_
4 #include <vector>
5 #include "vmath/vmath.h"
7 class GridCell;
8 class Tile;
10 class Level {
11 private:
12 // cells are stored as a linear array of pointers to GridCells
13 // null pointers mean unpopulated cells.
14 GridCell **cells;
15 int xsz, ysz;
16 float cell_size;
18 void draw_grid() const;
20 public:
21 Level();
22 ~Level();
24 bool load(const char *fname);
25 bool save(const char *fname) const;
27 const GridCell *get_cell(int x, int y) const;
28 Vector3 get_cell_pos(int x, int y) const;
30 void draw() const;
31 };
33 class GridCell {
34 private:
35 // each grid-cell might contain multiple tiles.
36 std::vector<const Tile*> tiles;
38 public:
39 void add_tile(const Tile *tile);
41 void draw() const;
42 };
44 #endif // LEVEL_H_