blob: 1fc836530edf7e020371bf8104ada316af175fdc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#ifndef VEHICLE_H
#define VEHICLE_H
#include "linkHistory.h"
#include <game/activity.h>
#include <game/network/link.h>
#include <game/orders.h>
#include <game/worldobject.h>
#include <gfx/renderable.h>
#include <memory>
class Location;
class Vehicle : public WorldObject, public Renderable {
public:
explicit Vehicle(const LinkPtr & link, float linkDist = 0);
float linkDist; // distance along current link
float speed {}; // speed in m/s (~75 km/h)
[[nodiscard]] virtual const Location & getLocation() const = 0;
Orders orders;
ActivityPtr currentActivity;
protected:
void move(TickDuration dur);
LinkHistory linkHist;
};
using VehicleWPtr = std::weak_ptr<Vehicle>;
#endif
|