summaryrefslogtreecommitdiff
path: root/game/vehicles/railVehicle.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-03-06 19:44:58 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-03-06 19:44:58 +0000
commite118b1f5d8071460e3a9d4d731c6d69221f785dc (patch)
tree64ea6b1761afba27d36319648e78ddd457670ff8 /game/vehicles/railVehicle.h
parentIntroduce the Train concept as a literal collection of rail vehicles (diff)
downloadilt-e118b1f5d8071460e3a9d4d731c6d69221f785dc.tar.bz2
ilt-e118b1f5d8071460e3a9d4d731c6d69221f785dc.tar.xz
ilt-e118b1f5d8071460e3a9d4d731c6d69221f785dc.zip
Carve up the mess in game/vehicles
Diffstat (limited to 'game/vehicles/railVehicle.h')
-rw-r--r--game/vehicles/railVehicle.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/game/vehicles/railVehicle.h b/game/vehicles/railVehicle.h
new file mode 100644
index 0000000..a089f1d
--- /dev/null
+++ b/game/vehicles/railVehicle.h
@@ -0,0 +1,29 @@
+#ifndef RAILVEHICLE_H
+#define RAILVEHICLE_H
+
+#include "gfx/renderable.h"
+#include "railVehicleClass.h"
+#include <array>
+#include <location.hpp>
+#include <memory>
+#include <utility>
+
+class Shader;
+
+class Train;
+class RailVehicle : public Renderable {
+public:
+ explicit RailVehicle(RailVehicleClassPtr rvc) : rvClass {std::move(rvc)} { }
+
+ void move(const Train *, float & trailBy);
+
+ void render(const Shader & shader) const override;
+
+ Location location;
+
+ RailVehicleClassPtr rvClass;
+ std::array<Location, 2> bogies;
+};
+using RailVehiclePtr = std::unique_ptr<RailVehicle>;
+
+#endif