1 /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */
2 
3 #ifndef _MOVE_DATA_H
4 #define _MOVE_DATA_H
5 
6 #include <vector>
7 #include <map>
8 #include <string>
9 
10 #include "System/creg/creg_cond.h"
11 
12 
13 namespace springLegacyAI {
14 
15 // FIXME: this is a million years behind the engine version now
16 struct MoveData {
17 	CR_DECLARE_STRUCT(MoveData)
18 
MoveDataMoveData19 	MoveData()
20 		: moveType(MoveData::Ground_Move)
21 		, moveFamily(MoveData::Tank)
22 		, terrainClass(MoveData::Mixed)
23 		, followGround(true)
24 		, xsize(0)
25 		, zsize(0)
26 		, depth(0.0f)
27 		, maxSlope(0.0f)
28 		, slopeMod(0.0f)
29 		, depthMod(0.0f)
30 		, pathType(0)
31 		, crushStrength(0.0f)
32 		, name("tank")
33 		, maxSpeed(0.0f)
34 		, maxTurnRate(0)
35 		, maxAcceleration(0.0f)
36 		, maxBreaking(0.0f)
37 		, subMarine(false)
38 		, heatMapping(true)
39 		, heatMod(0.05f)
40 		, heatProduced(30)
41 	{
42 	}
43 
44 	enum MoveType {
45 		Ground_Move = 0,
46 		Hover_Move  = 1,
47 		Ship_Move   = 2
48 	};
49 	enum MoveFamily {
50 		Tank  = 0,
51 		KBot  = 1,
52 		Hover = 2,
53 		Ship  = 3
54 	};
55 	enum TerrainClass {
56 		/// we are restricted to "land" (terrain with height >= 0)
57 		Land = 0,
58 		/// we are restricted to "water" (terrain with height < 0)
59 		Water = 1,
60 		/// we can exist at heights both greater and smaller than 0
61 		Mixed = 2
62 	};
63 
64 	/// NOTE: rename? (because of (AMoveType*) CUnit::moveType)
65 	MoveType moveType;
66 	MoveFamily moveFamily;
67 	TerrainClass terrainClass;
68 	/// do we stick to the ground when in water?
69 	bool followGround;
70 
71 	/// of the footprint
72 	int xsize;
73 	int zsize;
74 	/// minWaterDepth for ships, maxWaterDepth otherwise
75 	float depth;
76 	float maxSlope;
77 	float slopeMod;
78 	float depthMod;
79 
80 	int pathType;
81 	float crushStrength;
82 
83 	std::string name;
84 
85 
86 	// CMobility refugees
87 	float maxSpeed;
88 	short maxTurnRate;
89 
90 	float maxAcceleration;
91 	float maxBreaking;
92 
93 	/// are we supposed to be a purely sub-surface ship?
94 	bool subMarine;
95 
96 	/// heat-map this unit
97 	bool heatMapping;
98 	/// heat-map path cost modifier
99 	float heatMod;
100 	/// heat produced by a path
101 	int heatProduced;
102 };
103 
104 } // namespace springLegacyAI
105 
106 #endif // _MOVE_DATA_H
107