summaryrefslogtreecommitdiff
path: root/src/level.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/level.h')
-rw-r--r--src/level.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/level.h b/src/level.h
index e915da3..d24ccb4 100644
--- a/src/level.h
+++ b/src/level.h
@@ -5,8 +5,26 @@
#include <cstring>
#include <vector>
+#define TILE_TYPE(x) ((x)&0xf)
+#define TILE_DATA(x) (x >> 4 & 0xf)
+#define MAKE_TILE(t, d) ((((d) & 0xf) << 4) + ((t)&0xf))
+
class Train;
+enum TileType : uint8_t {
+ TileGround,
+ TileTrack
+};
+
+enum TrackDirection : uint8_t {
+ NorthSouth,
+ EastWest,
+ SouthEast,
+ SouthWest,
+ NorthWest,
+ NorthEast,
+};
+
class Level {
public:
Level(int width, int height, Bitmap& tileSprites);
@@ -30,13 +48,4 @@ private:
std::vector<Train*> m_vehicles;
};
-enum RailDirection {
- NorthSouth = 1,
- EastWest,
- SouthEast,
- SouthWest,
- NorthWest,
- NorthEast,
-};
-
-RailDirection ChooseDirection(Level& level, int x, int y); \ No newline at end of file
+TrackDirection ChooseDirection(Level& level, int x, int y); \ No newline at end of file