Rev 211 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#include "ShipData.h"#include "spkdef.h"CShipData::CShipData(void){this->CreateDefault();}CShipData::~CShipData(void){this->ClearLists();}Utils::WString CShipData::createData() const{Utils::WString data = this->sModel;data.addToken(L";", Utils::WString::Number(this->iPictureID));data.addToken(L";", Utils::WString::FromFloat(this->fRotX, -1));data.addToken(L";", Utils::WString::FromFloat(this->fRotY, -1));data.addToken(L";", Utils::WString::FromFloat(this->fRotZ, -1));data.addToken(L";", CShipData::ConvertShipSubType(this->iSubType));data.addToken(L";", Utils::WString::Number(this->iDesc));data.addToken(L";", Utils::WString::Number(this->iSpeed));data.addToken(L";", Utils::WString::Number(this->iAccel));data.addToken(L";", Utils::WString::Number(this->iEngineSound));data.addToken(L";", Utils::WString::Number(this->iReactionDelay));data.addToken(L";", Utils::WString::Number(this->iEngineEffect));data.addToken(L";", Utils::WString::Number(this->iEngineGlow));data.addToken(L";", Utils::WString::Number(this->iPower));data.addToken(L";", Utils::WString::Number(this->iSoundMin));data.addToken(L";", Utils::WString::Number(this->iSoundMax));data.addToken(L";", this->sModelScene);data.addToken(L";", this->sCockpitScene);data.addToken(L";", Utils::WString::Number(this->iLaserMask));data.addToken(L";", Utils::WString::Number(this->iGunCount));data.addToken(L";", Utils::WString::Number(this->iLaserEnergy));data.addToken(L";", Utils::WString::FromFloat(this->fLaserRecharge, -1));data.addToken(L";", Utils::WString::Number(this->iShieldType));data.addToken(L";", Utils::WString::Number(this->iMaxShields));data.addToken(L";", Utils::WString::Number(this->iMissileMask));data.addToken(L";", Utils::WString::Number(this->iMissileCount));data.addToken(L";", Utils::WString::Number(this->iSpeedExtension));data.addToken(L";", Utils::WString::Number(this->iSteeringExtension));data.addToken(L";", Utils::WString::Number(this->iCargoMin));data.addToken(L";", Utils::WString::Number(this->iCargoMax));data.addToken(L";", Utils::WString::Number(this->iWareListID));// 6 turrets nextfor ( int i = 0; i < 6; i++ ){if ( this->cockpits[i].sCockpit.empty() )data.addToken(L";", Utils::WString::Number(this->cockpits[i].iCockpit));else{if ( this->cockpits[i].iCockpit > -1 )data.addToken(L";", this->cockpits[i].sCockpit + L"(" + (long)this->cockpits[i].iCockpit + L")");elsedata.addToken(L";", this->cockpits[i].sCockpit);}data.addToken(L";", Utils::WString::Number(this->cockpits[i].iPos));}data.addToken(L";", Utils::WString::Number(this->iDocking));data.addToken(L";", Utils::WString::Number(this->iCargoClass));data.addToken(L";", Utils::WString::Number(this->iRace));data.addToken(L";", Utils::WString::Number(this->iHull));data.addToken(L";", Utils::WString::Number(this->iExplosionDef));data.addToken(L";", Utils::WString::Number(this->iExplosionBody));data.addToken(L";", Utils::WString::Number(this->iParticle));data.addToken(L";", Utils::WString::Number(this->iVariation));data.addToken(L";", Utils::WString::Number(this->iRotationAccel));data.addToken(L";", Utils::WString::Number(this->iClass));data.addToken(L";", Utils::WString::Number(this->iTurretCount));// now do the turretsfor ( int i = 0; i < this->iTurretCount; i++ ){STurretEntry *t = this->lTurrets[i];data.addToken(L";", Utils::WString::Number(t->iIndex));data.addToken(L";", Utils::WString::Number(t->iTurret));data.addToken(L";", t->sModel);data.addToken(L";", Utils::WString::Number(t->iSceneNode));}// the gun entries nextdata.addToken(L";", Utils::WString::Number(this->iGunsCount));for ( int i = 0; i < this->iGunsCount; i++ ){SGunGroup *g = this->lGuns[i];data.addToken(L";", Utils::WString::Number(g->iGunIndex));data.addToken(L";", Utils::WString::Number(g->iLaserCount));data.addToken(L";", Utils::WString::Number(g->iIndex));data.addToken(L";", Utils::WString::Number(g->iWeaponCount));for ( int j = 0; j < g->iWeaponCount; j++ ){SWeaponGroup *w = g->lWeapons[j];data.addToken(L";", Utils::WString::Number(w->iGunIndex));data.addToken(L";", Utils::WString::Number(w->iLaser));data.addToken(L";", w->sModel1);data.addToken(L";", Utils::WString::Number(w->iNode1));data.addToken(L";", w->sModel2);data.addToken(L";", Utils::WString::Number(w->iNode2));}}// now the rest of the datadata.addToken(L";", Utils::WString::Number(this->iVolumn));data.addToken(L";", Utils::WString::Number(this->iRelVal));data.addToken(L";", Utils::WString::Number(this->iPriceMod1));data.addToken(L";", Utils::WString::Number(this->iPriceMod2));data.addToken(L";", Utils::WString::Number(this->iSize));data.addToken(L";", Utils::WString::Number(this->iRelValPlayer));data.addToken(L";", Utils::WString::Number(this->iMinNoto));data.addToken(L";", Utils::WString::Number(this->iVideoID));data.addToken(L";", Utils::WString::Number(this->iSkin));data.addToken(L";", this->sID);data += L";"; // add the end ;return data;}void CShipData::CreateDefault(){this->sModel = L"0";this->iPictureID = 0;this->fRotX = 0.00f;this->fRotY = 0.00f;this->fRotZ = 0.00f;this->iSubType = 0;this->iDesc = 0;this->iSpeed = 0;this->iAccel = 0;this->iEngineSound = 106;this->iReactionDelay = 1;this->iEngineEffect = 5;this->iEngineGlow = 37;this->iPower = 0;this->iSoundMin = 112;this->iSoundMax = 202;this->sModelScene = L"";this->sCockpitScene = L"";this->iLaserMask = 0;this->iGunCount = 0;this->iLaserEnergy = 0;this->fLaserRecharge = 0.00f;this->iShieldType = 0;this->iMaxShields = 0;this->iMissileMask = 0;this->iMissileCount = 0;this->iSpeedExtension = 0;this->iSteeringExtension = 0;this->iCargoMin = 0;this->iCargoMax = 0;this->iWareListID = 0;this->iDocking = 0;this->iCargoClass = 0;this->iRace = 1;this->iHull = 0;this->iExplosionDef = 35;this->iExplosionBody = 36;this->iParticle = 1;this->iVariation = 0;this->iRotationAccel = 0;this->iClass = 0;this->iTurretCount = 0;this->iGunsCount = 0;this->iVolumn = 1;this->iRelVal = 0;this->iPriceMod1 = 25;this->iPriceMod2 = 1;this->iSize = 0;this->iRelValPlayer = 0;this->iMinNoto = 0;this->iVideoID = 0;this->iSkin = 0;this->sID = L"SC_NEW_SHIP";// make sure the lists are clearthis->ClearLists();}void CShipData::ClearLists(){this->lTurrets.MemoryClear();for ( SGunGroup *g = this->lGuns.First(); g; g = this->lGuns.Next() )g->lWeapons.MemoryClear();this->lGuns.MemoryClear();}bool CShipData::readShipData(const Utils::WString &a_data){std::vector<Utils::WString> entries;a_data.tokenise(L";", entries);if (entries.size() >= 60){this->sModel = entries[0];this->iPictureID = entries[1].toInt();this->fRotX = entries[2].toFloat();this->fRotY = entries[3].toFloat();this->fRotZ = entries[4].toFloat();if ( entries[5].isNumber() )this->iSubType = entries[5].toInt();elsethis->iSubType = CShipData::ConvertShipSubType(entries[5]);this->iDesc = entries[6].toInt();this->iSpeed = entries[7].toInt();this->iAccel = entries[8].toInt();this->iEngineSound = entries[9].toInt();this->iReactionDelay = entries[10].toInt();this->iEngineEffect = entries[11].toInt();this->iEngineGlow = entries[12].toInt();this->iPower = entries[13].toInt();this->iSoundMin = entries[14].toInt();this->iSoundMax = entries[15].toInt();this->sModelScene = entries[16];this->sCockpitScene = entries[17];this->iLaserMask = entries[18].toInt();this->iGunCount = entries[19].toInt();this->iLaserEnergy = entries[20].toInt();this->fLaserRecharge = entries[21].toFloat();this->iShieldType = entries[22].toInt();this->iMaxShields = entries[23].toInt();this->iMissileMask = entries[24].toInt();this->iMissileCount = entries[25].toInt();this->iSpeedExtension = entries[26].toInt();this->iSteeringExtension = entries[27].toInt();this->iCargoMin = entries[28].toInt();this->iCargoMax = entries[29].toInt();this->iWareListID = entries[30].toInt();for ( int i = 0; i < 6; i++ ){this->cockpits[i].iPos = entries[(i * 2) + 32].toInt();if ( entries[(i * 2) + 31].isNumber() )this->cockpits[i].iCockpit = entries[(i * 2) + 31].toInt();else{this->cockpits[i].sCockpit = entries[(i * 2) + 31];this->cockpits[i].iCockpit = -1; // custom cockpitif ( this->cockpits[i].sCockpit.contains(L"(") ) {this->cockpits[i].iCockpit = this->cockpits[i].sCockpit.tokens(L"(", 2).token(L")", 1).toInt();this->cockpits[i].sCockpit = this->cockpits[i].sCockpit.token(L"(", 1);}}}this->iDocking = entries[43].toInt();this->iCargoClass = entries[44].toInt();this->iRace = entries[45].toInt();this->iHull = entries[46].toInt();this->iExplosionDef = entries[47].toInt();this->iExplosionBody = entries[48].toInt();this->iParticle = entries[49].toInt();this->iVariation = entries[50].toInt();this->iRotationAccel = entries[51].toInt();if ( entries[52].isNumber() )this->iClass = entries[52].toInt();elsethis->iClass = CShipData::ConvertShipClass(entries[52]);this->iTurretCount = entries[53].toInt();// now read in the turret dataint pos = 54;for ( int i = 0; i < this->iTurretCount; i++ ){STurretEntry *t = new STurretEntry;t->iIndex = entries[pos].toInt();t->iTurret = entries[pos + 1].toInt();t->sModel = entries[pos + 2];t->iSceneNode = entries[pos + 3].toInt();this->lTurrets.push_back(t);pos += 4;}if ( this->iTurretCount == 0 ){this->iTurretCount = 1;STurretEntry *t = this->lTurrets.push_back(new STurretEntry);t->iIndex = 0;t->iTurret = 1;t->iSceneNode = 0;t->sModel = L"0";}// next pos should be gun countthis->iGunsCount = entries[pos].toInt();++pos;for ( int i = 0; i < this->iGunsCount; i++ ){SGunGroup *gun = new SGunGroup;gun->iGunIndex = entries[pos].toInt();gun->iLaserCount = entries[pos + 1].toInt();gun->iIndex = entries[pos + 2].toInt();gun->iWeaponCount = entries[pos + 3].toInt();pos += 4;for ( int j = 0; j < gun->iWeaponCount; j++ ){SWeaponGroup *weapon = new SWeaponGroup;weapon->iGunIndex = entries[pos].toInt();weapon->iLaser = entries[pos + 1].toInt();weapon->sModel1 = entries[pos + 2];weapon->iNode1 = entries[pos + 3].toInt();weapon->sModel2 = entries[pos + 4];weapon->iNode2 = entries[pos + 5].toInt();pos += 6;gun->lWeapons.push_back(weapon);}this->lGuns.push_back(gun);}if ( !this->iGunsCount ){this->iGunCount = 1;SGunGroup *gun = this->lGuns.push_back(new SGunGroup);gun->iGunIndex = 0;gun->iIndex = 0;gun->iLaserCount = 0;gun->iWeaponCount = 0;}this->iVolumn = entries[pos].toInt();this->iRelVal = entries[pos + 1].toInt();this->iPriceMod1 = entries[pos + 2].toInt();this->iPriceMod2 = entries[pos + 3].toInt();this->iSize = entries[pos + 4].toInt();this->iRelValPlayer = entries[pos + 5].toInt();this->iMinNoto = entries[pos + 6].toInt();this->iVideoID = entries[pos + 7].toInt();this->iSkin = entries[pos + 8].toInt();this->sID = entries[pos + 9];this->UpdateGunEntries();this->_capValues();return true;}return false;}void CShipData::_capValues(){if ( this->iRelVal > 25000000 ) this->iRelVal = 25000000;if ( this->iRelValPlayer > 25000000 ) this->iRelValPlayer = 25000000;}int CShipData::GetShipClassFromNum(int shipclass){int classes[OBJ_SHIP_MAX];classes[0] = OBJ_SHIP_TL;classes[1] = OBJ_SHIP_TS;classes[2] = OBJ_SHIP_TP;classes[3] = OBJ_SHIP_TM;classes[4] = OBJ_SHIP_TL_PIRATE;classes[5] = OBJ_SHIP_TS_PIRATE;classes[6] = OBJ_SHIP_GONER;classes[7] = OBJ_SHIP_M0;classes[8] = OBJ_SHIP_M1;classes[9] = OBJ_SHIP_M2;classes[10] = OBJ_SHIP_M3;classes[11] = OBJ_SHIP_M4;classes[12] = OBJ_SHIP_M5;classes[13] = OBJ_SHIP_M6;classes[14] = OBJ_SHIP_M7;classes[15] = OBJ_SHIP_M8;return classes[shipclass];}int CShipData::ConvertShipClassToNum(int shipclass){int classes[OBJ_SHIP_MAX];classes[0] = OBJ_SHIP_TL;classes[1] = OBJ_SHIP_TS;classes[2] = OBJ_SHIP_TP;classes[3] = OBJ_SHIP_TM;classes[4] = OBJ_SHIP_TL_PIRATE;classes[5] = OBJ_SHIP_TS_PIRATE;classes[6] = OBJ_SHIP_GONER;classes[7] = OBJ_SHIP_M0;classes[8] = OBJ_SHIP_M1;classes[9] = OBJ_SHIP_M2;classes[10] = OBJ_SHIP_M3;classes[11] = OBJ_SHIP_M4;classes[12] = OBJ_SHIP_M5;classes[13] = OBJ_SHIP_M6;classes[14] = OBJ_SHIP_M7;classes[15] = OBJ_SHIP_M8;for ( int i = 0; i < OBJ_SHIP_MAX; i++ ){if ( classes[i] == shipclass )return i;}return 0;}int CShipData::ConvertShipClass(const Utils::WString &shipclass){for ( int i = 0; i < OBJ_SHIP_MAX; i++ ){int c = CShipData::GetShipClassFromNum(i);if ( CShipData::ConvertShipClass(c).Compare(shipclass) )return c;}return OBJ_SHIP_TL;}Utils::WString CShipData::ConvertShipClass(int shipclass){switch ( shipclass ){case OBJ_SHIP_TL:return L"OBJ_SHIP_TL";case OBJ_SHIP_TS:return L"OBJ_SHIP_TS";case OBJ_SHIP_TP:return L"OBJ_SHIP_TP";case OBJ_SHIP_TM:return L"OBJ_SHIP_TS";case OBJ_SHIP_TL_PIRATE:return L"OBJ_SHIP_TL_PIRATE";case OBJ_SHIP_TS_PIRATE:return L"OBJ_SHIP_TS_PIRATE";case OBJ_SHIP_GONER:return L"OBJ_SHIP_GONER";case OBJ_SHIP_M0:return L"OBJ_SHIP_M0";case OBJ_SHIP_M1:return L"OBJ_SHIP_M1";case OBJ_SHIP_M2:return L"OBJ_SHIP_M2";case OBJ_SHIP_M3:return L"OBJ_SHIP_M3";case OBJ_SHIP_M4:return L"OBJ_SHIP_M4";case OBJ_SHIP_M5:return L"OBJ_SHIP_M5";case OBJ_SHIP_M6:return L"OBJ_SHIP_M6";case OBJ_SHIP_M7:return L"OBJ_SHIP_M7";case OBJ_SHIP_M8:return L"OBJ_SHIP_M8";}return L"OBJ_SHIP_TL";}Utils::WString CShipData::ConvertShipSubType(int subtype){switch ( subtype ){case SG_SH_TL:return L"SG_SH_TL";case SG_SH_TS:return L"SG_SH_TS";case SG_SH_M0:return L"SG_SH_M0";case SG_SH_M1:return L"SG_SH_M1";case SG_SH_M2:return L"SG_SH_M2";case SG_SH_M3:return L"SG_SH_M3";case SG_SH_M4:return L"SG_SH_M4";case SG_SH_M5:return L"SG_SH_M5";case SG_SH_TL_P:return L"SG_SH_TL_P";case SG_SH_TS_P:return L"SG_SH_TS_P";case SG_SH_GO:return L"SG_SH_GO";case SG_SH_M6:return L"SG_SH_M6";case SG_SH_TP:return L"SG_SH_TP";case SG_SH_M7:return L"SG_SH_M7";case SG_SH_TM:return L"SG_SH_TM";case SG_SH_M8:return L"SG_SH_M8";}return L"SG_SH_TL";}int CShipData::ConvertShipSubType(const Utils::WString &subtype){int num = 0;for ( int i = 0; i < SG_SH_MAX; i++ ){if ( subtype.Compare(CShipData::ConvertShipSubType(i)) )return i;}return 0;}void CShipData::RemoveTurret(int t){if ( t >= 1 && t <= 6 ){if ( t >= this->lTurrets.size() )return;// remove the turret entrythis->lTurrets.erase(t, true);int index = 0;for ( CListNode<STurretEntry> *node = this->lTurrets.Front(); node; node = node->next() ){node->Data()->iTurret = index;++index;node->Data()->iIndex = index;}--this->iTurretCount;// shuffle the other entriesfor ( int i = (t - 1); i < 5; i++ ){this->cockpits[i].iCockpit = this->cockpits[i + 1].iCockpit;this->cockpits[i].iPos = this->cockpits[i + 1].iPos;this->cockpits[i].sCockpit = this->cockpits[i + 1].sCockpit;}// zero out the remainingthis->cockpits[5].iCockpit = 0;this->cockpits[5].iPos = 0;this->cockpits[5].sCockpit = L"";// now remove the gun entries connected to the turretSGunGroup *g = this->lGuns.Get(t);if ( g ){g->lWeapons.MemoryClear();this->lGuns.remove(g, true);--this->iGunsCount;}// now we need to readjust the gun entrysthis->UpdateGunEntries();}}void CShipData::UpdateGunEntries(){int index = 1;int count = 1;int gunindex = 1;this->iGunCount = 0;for ( CListNode<SGunGroup> *node = this->lGuns.Front(); node; node = node->next() ){SGunGroup *g = node->Data();g->iLaserCount = 0;for ( CListNode<SWeaponGroup> *wNode = g->lWeapons.Front(); wNode; wNode = wNode->next() ){SWeaponGroup *w = wNode->Data();if ( (w->iNode1 > 0 || (w->iNode1 == 0 && w->sModel1 != L"0")) && !w->sModel1.empty() ){w->iLaser = 1;if ( (w->iNode2 > 0 || (w->iNode2 == 0 && w->sModel2 != L"0")) && !w->sModel2.empty() )w->iLaser = 2;}else{w->iLaser = 0;w->iNode2 = -1;w->sModel2 = L"";}w->iGunIndex = gunindex;gunindex += w->iLaser;g->iLaserCount += w->iLaser;}g->iWeaponCount = g->lWeapons.size();g->iGunIndex = index;index += g->iLaserCount;this->iGunCount += g->iLaserCount;g->iIndex = count;++count;}this->iTurretCount = this->lTurrets.size();this->iGunsCount = this->lGuns.size();}void CShipData::ClearTurrets(){for ( int i = 0; i < 6; i++ ){this->cockpits[i].iCockpit = 0;this->cockpits[i].iPos = 0;this->cockpits[i].sCockpit = L"";}while ( this->lTurrets.size() > 1 )this->lTurrets.erase(1, true);while ( this->lGuns.size() > 1 )this->lGuns.erase(1, true);this->iTurretCount = 1;this->iGunsCount = 1;}void CShipData::AddNewTurret(int dir){if ( this->iTurretCount >= 7 )return;STurretEntry *t = new STurretEntry;SGunGroup *g = new SGunGroup;t->iSceneNode = 0;t->iIndex = this->iTurretCount + 1;t->iTurret = this->iTurretCount;this->cockpits[(this->iTurretCount - 1)].iCockpit = 0;this->cockpits[(this->iTurretCount - 1)].iPos = dir;g->iWeaponCount = 1;g->iLaserCount = 0;SWeaponGroup *w = new SWeaponGroup;w->iLaser = 0;w->iNode1 = 0;w->iNode2 = -1;w->sModel1 = L"0";g->lWeapons.push_back(w);this->lTurrets.push_back(t);this->lGuns.push_back(g);++this->iTurretCount;++this->iGunsCount;this->UpdateGunEntries();}Utils::WString CShipData::ConvertMissileGroup(int type){switch ( type ){case SG_MISSILE_LIGHT:return L"SG_MISSILE_LIGHT";case SG_MISSILE_MEDIUM:return L"SG_MISSILE_MEDIUM";case SG_MISSILE_HEAVY:return L"SG_MISSILE_HEAVY";case SG_MISSILE_TR_LIGHT:return L"SG_MISSILE_TR_LIGHT";case SG_MISSILE_TR_MEDIUM:return L"SG_MISSILE_TR_MEDIUM";case SG_MISSILE_TR_HEAVY:return L"SG_MISSILE_TR_HEAVY";case SG_MISSILE_KHAAK:return L"SG_MISSILE_KHAAK";case SG_MISSILE_BOMBER:return L"SG_MISSILE_BOMBOER";case SG_MISSILE_TORP_CAPTIAL:return L"SG_MISSILE_TORP_CAPTIAL";case SG_MISSILE_AF_CAPTIAL:return L"SG_MISSILE_AF_CAPTIAL";case SG_MISSILE_TR_BOMBER:return L"SG_MISSILE_TR_BOMBER";case SG_MISSILE_TR_TORP_CAPTIAL:return L"SG_MISSILE_TR_TORP_CAPTIAL";case SG_MISSILE_TR_AF_CAPTIAL:return L"SG_MISSILE_TR_AF_CAPTIAL";case SG_MISSILE_BOARDINGPOD:return L"SG_MISSILE_BOARDINGPOD";case SG_MISSILE_DMBF:return L"SG_MISSILE_DMBF";case SG_MISSILE_DISRUPTOR:return L"SG_MISSILE_DISRUPTOR";}return L"";}int CShipData::ConvertMissileGroupToID(int type){int arr[] = {SG_MISSILE_LIGHT, SG_MISSILE_MEDIUM, SG_MISSILE_HEAVY, SG_MISSILE_TR_LIGHT, SG_MISSILE_TR_MEDIUM, SG_MISSILE_TR_HEAVY, SG_MISSILE_KHAAK, SG_MISSILE_BOMBER, SG_MISSILE_TORP_CAPTIAL,SG_MISSILE_AF_CAPTIAL, SG_MISSILE_TR_BOMBER, SG_MISSILE_TR_TORP_CAPTIAL, SG_MISSILE_AF_CAPTIAL, SG_MISSILE_BOARDINGPOD, SG_MISSILE_DMBF, SG_MISSILE_DISRUPTOR };for ( int i = 0; i < SG_MISSILE_MAX; i++ ){if ( arr[i] == type )return i;}return 0;}int CShipData::ConvertMissileGroupToID(const Utils::WString &type){return CShipData::ConvertMissileGroupToID(CShipData::ConvertMissileGroup(type));}int CShipData::ConvertMissileGroup(const Utils::WString &type){if ( type.Compare(L"SG_MISSILE_LIGHT") )return SG_MISSILE_LIGHT;if ( type.Compare(L"SG_MISSILE_MEDIUM") )return SG_MISSILE_MEDIUM;if ( type.Compare(L"SG_MISSILE_HEAVY") )return SG_MISSILE_HEAVY;if ( type.Compare(L"SG_MISSILE_TR_LIGHT") )return SG_MISSILE_TR_LIGHT;if ( type.Compare(L"SG_MISSILE_TR_MEDIUM") )return SG_MISSILE_TR_MEDIUM;if ( type.Compare(L"SG_MISSILE_TR_HEAVY") )return SG_MISSILE_TR_HEAVY;if ( type.Compare(L"SG_MISSILE_KHAAK") )return SG_MISSILE_KHAAK;if ( type.Compare(L"SG_MISSILE_BOMBER") )return SG_MISSILE_BOMBER;if ( type.Compare(L"SG_MISSILE_TORP_CAPTIAL") )return SG_MISSILE_TORP_CAPTIAL;if ( type.Compare(L"SG_MISSILE_AF_CAPTIAL") )return SG_MISSILE_AF_CAPTIAL;if ( type.Compare(L"SG_MISSILE_TR_BOMBER") )return SG_MISSILE_TR_BOMBER;if ( type.Compare(L"SG_MISSILE_TR_TORP_CAPTIAL") )return SG_MISSILE_TR_TORP_CAPTIAL;if ( type.Compare(L"SG_MISSILE_TR_AF_CAPTIAL") )return SG_MISSILE_TR_AF_CAPTIAL;if ( type.Compare(L"SG_MISSILE_BOARDINGPOD") )return SG_MISSILE_BOARDINGPOD;if (type.Compare(L"SG_MISSILE_DMBF"))return SG_MISSILE_DMBF;if (type.Compare(L"SG_MISSILE_DISRUPTOR"))return SG_MISSILE_DISRUPTOR;return 0;}