diff options
author | Jun Zhang <jun@junz.org> | 2022-01-30 12:30:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-29 21:30:02 -0700 |
commit | cb7af3f4cac90f95926477b4001f9f80037568d5 (patch) | |
tree | 022f4700c796a9935acd3ee0d0fd80a812a78464 /src/train.h | |
parent | 99b4763f1028e72bb06d8db6c7e8ace469f8989c (diff) |
refactor: adjust the project infra. (#1)
* refactor: adjust the project infra.
This patch adds cmake build system to the project, and adjust infrastructure
stuff.
Signed-off-by: Jun Zhang <jun@junz.org>
* fix: remove compiler flags that only exist in GCC.
Signed-off-by: Jun Zhang <jun@junz.org>
Diffstat (limited to 'src/train.h')
-rw-r--r-- | src/train.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/train.h b/src/train.h new file mode 100644 index 0000000..ed0de94 --- /dev/null +++ b/src/train.h @@ -0,0 +1,27 @@ +#pragma once + +#include "bitmap.h" + +enum CarDirection { + North, + East, + South, + West +}; + +class Level; + +class TrainCar { +public: + TrainCar(int x, int y) + : x(x), y(y), m_sprite("../res/car.png") {} + + void update(Level&); + void draw(Bitmap&, int, int); + + int x, y; +private: + Bitmap m_sprite; + int m_progress; + CarDirection m_dir; +}; |