summaryrefslogtreecommitdiff
path: root/game/vehicles/train.h
diff options
context:
space:
mode:
Diffstat (limited to 'game/vehicles/train.h')
-rw-r--r--game/vehicles/train.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/game/vehicles/train.h b/game/vehicles/train.h
new file mode 100644
index 0000000..34a9d28
--- /dev/null
+++ b/game/vehicles/train.h
@@ -0,0 +1,33 @@
+#ifndef TRAIN_H
+#define TRAIN_H
+
+#include "game/network/link.h"
+#include "game/worldobject.h"
+#include "railVehicle.h"
+#include "vehicle.h"
+#include <collection.hpp>
+#include <location.hpp>
+#include <memory>
+#include <vector>
+
+class Shader;
+
+class Train : public Vehicle, public Collection<RailVehicle, false> {
+public:
+ explicit Train(const LinkPtr & link, float linkDist = 0) : Vehicle {link, linkDist} { }
+
+ [[nodiscard]] const Location &
+ getLocation() const override
+ {
+ return objects.front()->location;
+ }
+
+ void render(const Shader & shader) const override;
+
+ void tick(TickDuration elapsed) override;
+
+ void move(TickDuration dur);
+ [[nodiscard]] Location getBogiePosition(float linkDist, float dist) const;
+};
+
+#endif