1 #ifndef _COCKPIT_GENERIC_H_
2 #define _COCKPIT_GENERIC_H_
8 using namespace XMLSupport;
11 CP_FRONT,
CP_BACK,
CP_LEFT,
CP_RIGHT,
CP_VIEWTARGET,
CP_PANINSIDE,
CP_CHASE,
CP_PAN,
CP_PANTARGET,
CP_TARGET,
CP_FIXED,
69 static void beginElement(
void *userData,
const XML_Char *name,
const XML_Char **atts );
70 static void endElement(
void *userData,
const XML_Char *name );
74 virtual void Delete();
99 std::vector< std::string > unitfilename;
100 std::vector< std::string > unitsystemname;
101 std::vector< std::string > unitbasename;
114 void updateAttackers();
115 static bool tooManyAttackers();
119 return autopilot_time > 0;
121 bool unitInAutoRegion(
Unit *un );
132 virtual void InitStatic();
135 virtual int Autopilot(
Unit *target );
136 void RestoreGodliness();
142 while ( which >= unitfilename.size() )
143 unitfilename.push_back(
"");
144 return unitfilename[which];
149 while ( which >= unitsystemname.size() )
150 unitsystemname.push_back(
"");
151 return unitsystemname[which];
156 while ( which >= unitbasename.size() )
157 unitbasename.push_back(
"");
158 return unitbasename[which];
161 const std::string& GetUnitFileName(
unsigned int which = 0)
const;
162 const std::string& GetUnitSystemName(
unsigned int which = 0)
const;
163 const std::string& GetUnitBaseName(
unsigned int which = 0)
const;
165 void RemoveUnit(
unsigned int which = 0);
167 static std::string MakeBaseName(
const Unit *base);
176 return unitfilename.size();
179 void PackUnitInfo(vector< std::string > &info)
const;
181 void UnpackUnitInfo(vector< std::string > &info);
187 Cockpit(
const char *
file,
Unit *parent,
const std::string &pilotname );
195 virtual void Init(
const char *
file,
bool defaultCockpit =
false );
196 void recreate(
const std::string &pilotname );
201 virtual void SetParent(
Unit *unit,
const char *
filename,
const char *unitmodname,
const QVector &startloc );
204 return parent.GetUnit();
206 Unit * GetSaveParent();
210 virtual void UpdAutoPilot();
225 virtual void Eject();
226 virtual void EjectDock();
227 virtual void SetInsidePanYawSpeed(
float speed );
228 virtual void SetInsidePanPitchSpeed(
float speed );
259 virtual void visitSystem( std::string systemName );