]> git.localhorst.tv Git - orbi.git/blob - src/world/Tile.h
initial collision tests
[orbi.git] / src / world / Tile.h
1 #ifndef ORBI_TILE_H_
2 #define ORBI_TILE_H_
3
4 namespace orbi {
5
6 class Tile {
7
8 public:
9         explicit Tile(int fg = -1, int bg = -1)
10         : fg(fg), bg(bg) { }
11
12 public:
13         bool HasFG() const { return fg >= 0; }
14         int GetFG() const { return fg; }
15         bool MatchesFG(const Tile &other) const { return fg == other.fg; }
16
17         bool HasBG() const { return bg >= 0; }
18         int GetBG() const { return bg; }
19         bool MatchesBG(const Tile &other) const { return bg == other.bg; }
20
21         bool IsSolid() const { return HasFG(); }
22
23 private:
24         int fg;
25         int bg;
26
27 };
28
29 }
30
31 #endif