Subversion Repositories spk

Rev

Rev 211 | 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,
238 cycrow 71
	SG_MISSILE_DISRUPTOR		= 32768,
72
	SG_MISSILE_MAX				= 16
1 cycrow 73
} MissileFlags;
74
 
75
/**
76
 * structure for ships individual guns
77
 */
78
typedef struct SWeaponGroup {
170 cycrow 79
	int				iGunIndex;
80
	int				iLaser;
211 cycrow 81
	Utils::WString	sModel1;
170 cycrow 82
	int				iNode1;
211 cycrow 83
	Utils::WString	sModel2;
170 cycrow 84
	int				iNode2;
1 cycrow 85
} SWeaponGroup;
86
 
87
/**
88
 * structure for each gun placement on the ships
89
 * Can hold multiple weapons
90
 */
91
typedef struct SGunGroup {
92
	int			iGunIndex;
93
	int			iLaserCount;
94
	int			iIndex;
95
	int			iWeaponCount;
96
	CLinkList<SWeaponGroup> lWeapons;
97
} SGunGroup;
98
 
99
/**
100
 * structure for each turret cockpit on the ship
101
 */
102
typedef struct STurretEntry
103
{
170 cycrow 104
	int				iIndex;
105
	int				iTurret;
211 cycrow 106
	Utils::WString	sModel;
170 cycrow 107
	int				iSceneNode;
1 cycrow 108
} STurretEntry;
109
 
110
typedef struct STurretData {
170 cycrow 111
	int				iPos;
112
	int				iCockpit;
211 cycrow 113
	Utils::WString	sCockpit;
1 cycrow 114
} STurretData;
115
 
116
/**
117
 * Class to split the TShips data into individual values
118
 */
119
class SPKEXPORT CShipData
120
{
121
public:
122
	CShipData(void);
211 cycrow 123
	CShipData(const Utils::WString &a_data)
1 cycrow 124
	{
170 cycrow 125
		this->readShipData(a_data);
1 cycrow 126
	}
127
	virtual ~CShipData(void);
128
 
211 cycrow 129
	Utils::WString createData() const;
1 cycrow 130
	void CreateDefault();
131
	void ClearLists();
211 cycrow 132
	bool readShipData(const Utils::WString &a_data);
1 cycrow 133
	void UpdateGunEntries();
134
	void AddNewTurret(int dir);
135
 
136
	void ClearTurrets();
137
	void RemoveTurret(int t);
138
 
211 cycrow 139
	static Utils::WString ConvertShipSubType(int subtype);
140
	static Utils::WString ConvertShipClass(int shipclass);
170 cycrow 141
	static int			GetShipClassFromNum(int shipclass);
211 cycrow 142
	static int			ConvertShipSubType(const Utils::WString &subtype);
170 cycrow 143
	static int			ConvertShipClassToNum(int shipclass);
211 cycrow 144
	static int			ConvertShipClass(const Utils::WString &shipclass);
145
	static int			ConvertMissileGroup(const Utils::WString &type);
146
	static int			ConvertMissileGroupToID(const Utils::WString &type);
170 cycrow 147
	static int			ConvertMissileGroupToID(int type);
211 cycrow 148
	static Utils::WString	ConvertMissileGroup(int type);
1 cycrow 149
 
211 cycrow 150
	Utils::WString	sModel;
170 cycrow 151
	int				iPictureID;
152
	float			fRotX, fRotY, fRotZ;
153
	int				iSubType;
154
	int				iDesc;
155
	int				iRace;
156
	int				iVariation;
157
	int				iClass;
158
	int				iDocking;
159
	int				iSpeed;
160
	int				iAccel;
161
	int				iEngineSound;
162
	int				iReactionDelay;
163
	int				iEngineEffect;
164
	int				iEngineGlow;
165
	int				iPower;
166
	int				iSoundMin;
167
	int				iSoundMax;
211 cycrow 168
	Utils::WString	sModelScene;
169
	Utils::WString	sCockpitScene;
170 cycrow 170
	int				iLaserMask;
171
	int				iGunCount;
172
	int				iLaserEnergy;
173
	float			fLaserRecharge;
174
	int				iShieldType;
175
	int				iMaxShields;
176
	int				iMissileMask;
177
	int				iMissileCount;
178
	int				iSpeedExtension;
179
	int				iSteeringExtension;
180
	int				iCargoMin;
181
	int				iCargoMax;
182
	int				iWareListID;
183
	STurretData		cockpits[6];
184
	int				iCargoClass;
185
	int				iHull;
186
	int				iExplosionDef;
187
	int				iExplosionBody;
188
	int				iParticle;
189
	int				iRotationAccel;
190
	int				iTurretCount;
1 cycrow 191
	CLinkList<STurretEntry> lTurrets;
170 cycrow 192
	int				iGunsCount;
1 cycrow 193
	CLinkList<SGunGroup> lGuns;
170 cycrow 194
	int				iVolumn;
195
	int				iRelVal;
196
	int				iPriceMod1;
197
	int				iPriceMod2;
198
	int				iSize;
199
	int				iRelValPlayer;
200
	int				iMinNoto;
201
	int				iVideoID;
202
	int				iSkin;
197 cycrow 203
	Utils::WString	sID;
59 cycrow 204
 
205
private:
206
	void _capValues();
1 cycrow 207
};