Subversion Repositories spk

Rev

Rev 94 | Rev 197 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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