Subversion Repositories spk

Rev

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

Rev 197 Rev 211
Line 2... Line 2...
2
 
2
 
3
#include "lists.h"
3
#include "lists.h"
4
#include "Utils/String.h"
-
 
5
#include "Utils/WString.h"
4
#include "Utils/WString.h"
6
 
5
 
7
/**
6
/**
8
 * Ship class defines
7
 * Ship class defines
9
 */
8
 */
Line 76... Line 75...
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
	Utils::String	sModel1;
80
	Utils::WString	sModel1;
82
	int				iNode1;
81
	int				iNode1;
83
	Utils::String	sModel2;
82
	Utils::WString	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
Line 101... Line 100...
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
	Utils::String	sModel;
105
	Utils::WString	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
	Utils::String	sCockpit;
112
	Utils::WString	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(const Utils::String &a_data)
122
	CShipData(const Utils::WString &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
	Utils::String createData() const;
128
	Utils::WString createData() const;
130
	void CreateDefault();
129
	void CreateDefault();
131
	void ClearLists();
130
	void ClearLists();
132
	bool readShipData(const Utils::String &a_data);
131
	bool readShipData(const Utils::WString &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 Utils::String ConvertShipSubType(int subtype);
138
	static Utils::WString ConvertShipSubType(int subtype);
140
	static Utils::String ConvertShipClass(int shipclass);
139
	static Utils::WString ConvertShipClass(int shipclass);
141
	static int			GetShipClassFromNum(int shipclass);
140
	static int			GetShipClassFromNum(int shipclass);
142
	static int			ConvertShipSubType(const Utils::String &subtype);
141
	static int			ConvertShipSubType(const Utils::WString &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::WString &shipclass);
145
	static int			ConvertMissileGroup(const Utils::String &type);
144
	static int			ConvertMissileGroup(const Utils::WString &type);
146
	static int			ConvertMissileGroupToID(const Utils::String &type);
145
	static int			ConvertMissileGroupToID(const Utils::WString &type);
147
	static int			ConvertMissileGroupToID(int type);
146
	static int			ConvertMissileGroupToID(int type);
148
	static Utils::String	ConvertMissileGroup(int type);
147
	static Utils::WString	ConvertMissileGroup(int type);
149
 
148
 
150
	Utils::String	sModel;
149
	Utils::WString	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;
Line 163... Line 162...
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
	Utils::String	sModelScene;
167
	Utils::WString	sModelScene;
169
	Utils::String	sCockpitScene;
168
	Utils::WString	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;