summaryrefslogtreecommitdiff
path: root/game/vehicles/railVehicleClass.h
blob: 1a52e2bc818ee1c22f625f4a24f1aacbaf7dff59 (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
#pragma once

#include "assetFactory/asset.h"
#include "gfx/models/mesh.h"
#include <array>
#include <memory>
#include <string>

class SceneShader;
class ShadowMapper;
class Texture;
class Location;

class RailVehicleClass : public Asset {
public:
	void render(const SceneShader &, const Location &, const std::array<Location, 2> &) const;
	void shadows(const ShadowMapper &, const Location &, const std::array<Location, 2> &) const;

	std::array<Mesh::Ptr, 2> bogies;
	Mesh::Ptr bodyMesh;
	std::shared_ptr<Texture> texture;
	float wheelBase;
	float length;
	float maxSpeed;

protected:
	friend Persistence::SelectionPtrBase<std::shared_ptr<RailVehicleClass>>;
	bool persist(Persistence::PersistenceStore & store) override;
	void postLoad() override;
};
using RailVehicleClassPtr = std::shared_ptr<RailVehicleClass>;