blob: 6224c152bc9527ddada09e9bb2edeaf1510c2bcd (
plain) (
blame)
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
|
#ifndef LEVEL_H_678CFCCF
#define LEVEL_H_678CFCCF
#include "consts.h"
#include "tileset.h"
class Level {
public:
Level()
{
size_ = LEVEL_SIZE;
tiles_.resize(size_.w() * size_.h());
}
const vec2s& getSize() const
{
return size_;
}
size_t at(vec2s pos) const
{
return at(pos.x(), pos.y());
}
size_t at(size_t x, size_t y) const
{
return tiles_.at(x + size_.w() * y);
}
const Tileset& getTileset() const
{
return tileset_;
}
private:
vec2s size_;
std::vector<size_t> tiles_;
Tileset tileset_;
};
#endif /* end of include guard: LEVEL_H_678CFCCF */
|