summaryrefslogtreecommitdiff
path: root/game/vehicles/linkHistory.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/linkHistory.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/linkHistory.h')
-rw-r--r--game/vehicles/linkHistory.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/game/vehicles/linkHistory.h b/game/vehicles/linkHistory.h
new file mode 100644
index 0000000..31d0023
--- /dev/null
+++ b/game/vehicles/linkHistory.h
@@ -0,0 +1,21 @@
+#ifndef LINKHISTORY_H
+#define LINKHISTORY_H
+
+#include <game/network/link.h>
+#include <utility>
+#include <vector>
+
+class LinkHistory {
+public:
+ using WEntry = std::pair<LinkWPtr, unsigned char /*dir*/>;
+ using Entry = std::pair<LinkCPtr, unsigned char /*dir*/>;
+ Entry add(const LinkWPtr &, unsigned char);
+ [[nodiscard]] Entry getCurrent() const;
+ [[nodiscard]] Entry getAt(float, float *) const;
+
+private:
+ std::vector<WEntry> links;
+ float totalLen {0.F};
+};
+
+#endif