Subversion Repositories spk

Rev

Rev 197 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 cycrow 1
#pragma once
2
 
3
#include "lists.h"
197 cycrow 4
#include "Utils/WString.h"
1 cycrow 5
 
6
/**
7
 * Ship class defines
8
 */
9
typedef enum {
10
	SG_SH_TL,	
11
	SG_SH_TS,
12
	SG_SH_M0,
13
	SG_SH_M1,
14
	SG_SH_M2,
15
	SG_SH_M3,
16
	SG_SH_M4,
17
	SG_SH_M5,
18
	SG_SH_TL_P,
19
	SG_SH_TS_P,
20
	SG_SH_GO,
21
	SG_SH_M6,
22
	SG_SH_TP,
23
	SG_SH_M7, 
24
	SG_SH_TM, 
25
	SG_SH_M8, 
26
	SG_SH_MAX
27
} ShipClasses;
28
 
29
/**
30
 * Ship Object Classes
31
 */
32
typedef enum {
33
	OBJ_SHIP_M0			= 2020,
34
	OBJ_SHIP_M1			= 2021,
35
	OBJ_SHIP_M2			= 2022,
36
	OBJ_SHIP_M3			= 2023,
37
	OBJ_SHIP_M4			= 2024,
38
	OBJ_SHIP_M5			= 2025,
39
	OBJ_SHIP_M6			= 2026,
40
	OBJ_SHIP_M7			= 2027,
41
	OBJ_SHIP_TP			= 2030,
42
	OBJ_SHIP_TS			= 2031,
43
	OBJ_SHIP_TL			= 2032,
44
	OBJ_SHIP_M8			= 2142,
45
	OBJ_SHIP_TM			= 2141,
46
	OBJ_SHIP_TS_PIRATE	= 2035,
47
	OBJ_SHIP_TL_PIRATE	= 2036,
48
	OBJ_SHIP_GONER		= 2039,
49
	OBJ_SHIP_MAX		= 16
50
} ShipObjectClasses;
51
 
52
/**
53
 * Missle flags
54
 */
55
typedef enum {
56
	SG_MISSILE_LIGHT			= 1,
57
	SG_MISSILE_MEDIUM			= 2,
58
	SG_MISSILE_HEAVY			= 4,
59
	SG_MISSILE_TR_LIGHT			= 8,
60
	SG_MISSILE_TR_MEDIUM		= 16,
61
	SG_MISSILE_TR_HEAVY			= 32,
62
	SG_MISSILE_KHAAK			= 64,
63
	SG_MISSILE_BOMBER			= 128,
64
	SG_MISSILE_TORP_CAPTIAL		= 256,
65
	SG_MISSILE_AF_CAPTIAL		= 512,
66
	SG_MISSILE_TR_BOMBER		= 1024,
67
	SG_MISSILE_TR_TORP_CAPTIAL	= 2048,
68
	SG_MISSILE_TR_AF_CAPTIAL	= 4096,
69
	SG_MISSILE_BOARDINGPOD		= 8192,
70
	SG_MISSILE_DMBF				= 16384,
71
	SG_MISSILE_MAX				= 15
72
} MissileFlags;
73
 
74
/**
75
 * structure for ships individual guns
76
 */
77
typedef struct SWeaponGroup {
170 cycrow 78
	int				iGunIndex;
79
	int				iLaser;
211 cycrow 80
	Utils::WString	sModel1;
170 cycrow 81
	int				iNode1;
211 cycrow 82
	Utils::WString	sModel2;
170 cycrow 83
	int				iNode2;
1 cycrow 84
} SWeaponGroup;
85
 
86
/**
87
 * structure for each gun placement on the ships
88
 * Can hold multiple weapons
89
 */
90
typedef struct SGunGroup {
91
	int			iGunIndex;
92
	int			iLaserCount;
93
	int			iIndex;
94
	int			iWeaponCount;
95
	CLinkList<SWeaponGroup> lWeapons;
96
} SGunGroup;
97
 
98
/**
99
 * structure for each turret cockpit on the ship
100
 */
101
typedef struct STurretEntry
102
{
170 cycrow 103
	int				iIndex;
104
	int				iTurret;
211 cycrow 105
	Utils::WString	sModel;
170 cycrow 106
	int				iSceneNode;
1 cycrow 107
} STurretEntry;
108
 
109
typedef struct STurretData {
170 cycrow 110
	int				iPos;
111
	int				iCockpit;
211 cycrow 112
	Utils::WString	sCockpit;
1 cycrow 113
} STurretData;
114
 
115
/**
116
 * Class to split the TShips data into individual values
117
 */
118
class SPKEXPORT CShipData
119
{
120
public:
121
	CShipData(void);
211 cycrow 122
	CShipData(const Utils::WString &a_data)
1 cycrow 123
	{
170 cycrow 124
		this->readShipData(a_data);
1 cycrow 125
	}
126
	virtual ~CShipData(void);
127
 
211 cycrow 128
	Utils::WString createData() const;
1 cycrow 129
	void CreateDefault();
130
	void ClearLists();
211 cycrow 131
	bool readShipData(const Utils::WString &a_data);
1 cycrow 132
	void UpdateGunEntries();
133
	void AddNewTurret(int dir);
134
 
135
	void ClearTurrets();
136
	void RemoveTurret(int t);
137
 
211 cycrow 138
	static Utils::WString ConvertShipSubType(int subtype);
139
	static Utils::WString ConvertShipClass(int shipclass);
170 cycrow 140
	static int			GetShipClassFromNum(int shipclass);
211 cycrow 141
	static int			ConvertShipSubType(const Utils::WString &subtype);
170 cycrow 142
	static int			ConvertShipClassToNum(int shipclass);
211 cycrow 143
	static int			ConvertShipClass(const Utils::WString &shipclass);
144
	static int			ConvertMissileGroup(const Utils::WString &type);
145
	static int			ConvertMissileGroupToID(const Utils::WString &type);
170 cycrow 146
	static int			ConvertMissileGroupToID(int type);
211 cycrow 147
	static Utils::WString	ConvertMissileGroup(int type);
1 cycrow 148
 
211 cycrow 149
	Utils::WString	sModel;
170 cycrow 150
	int				iPictureID;
151
	float			fRotX, fRotY, fRotZ;
152
	int				iSubType;
153
	int				iDesc;
154
	int				iRace;
155
	int				iVariation;
156
	int				iClass;
157
	int				iDocking;
158
	int				iSpeed;
159
	int				iAccel;
160
	int				iEngineSound;
161
	int				iReactionDelay;
162
	int				iEngineEffect;
163
	int				iEngineGlow;
164
	int				iPower;
165
	int				iSoundMin;
166
	int				iSoundMax;
211 cycrow 167
	Utils::WString	sModelScene;
168
	Utils::WString	sCockpitScene;
170 cycrow 169
	int				iLaserMask;
170
	int				iGunCount;
171
	int				iLaserEnergy;
172
	float			fLaserRecharge;
173
	int				iShieldType;
174
	int				iMaxShields;
175
	int				iMissileMask;
176
	int				iMissileCount;
177
	int				iSpeedExtension;
178
	int				iSteeringExtension;
179
	int				iCargoMin;
180
	int				iCargoMax;
181
	int				iWareListID;
182
	STurretData		cockpits[6];
183
	int				iCargoClass;
184
	int				iHull;
185
	int				iExplosionDef;
186
	int				iExplosionBody;
187
	int				iParticle;
188
	int				iRotationAccel;
189
	int				iTurretCount;
1 cycrow 190
	CLinkList<STurretEntry> lTurrets;
170 cycrow 191
	int				iGunsCount;
1 cycrow 192
	CLinkList<SGunGroup> lGuns;
170 cycrow 193
	int				iVolumn;
194
	int				iRelVal;
195
	int				iPriceMod1;
196
	int				iPriceMod2;
197
	int				iSize;
198
	int				iRelValPlayer;
199
	int				iMinNoto;
200
	int				iVideoID;
201
	int				iSkin;
197 cycrow 202
	Utils::WString	sID;
59 cycrow 203
 
204
private:
205
	void _capValues();
1 cycrow 206
};