[Gcblue-commits] gcb_wx/src/scriptinterface tcFlightPortInterface.cpp, 1.12, 1.13 tcPlatformInterfa
Status: Alpha
Brought to you by:
ddcforge
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:08
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8446/src/scriptinterface Modified Files: tcFlightPortInterface.cpp tcPlatformInterface.cpp tcPlatformInterfaceExtensionB.cpp Log Message: Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** tcPlatformInterface.cpp 16 Sep 2006 14:01:24 -0000 1.65 --- tcPlatformInterface.cpp 24 Oct 2006 01:34:05 -0000 1.66 *************** *** 361,366 **** --- 361,402 ---- } + /** + * @param class_mask see below: + * PTYPE_UNKNOWN 0x0000 + * PTYPE_SURFACE 0x0010 + * PTYPE_SMALLSURFACE 0x0011 + * PTYPE_LARGESURFACE 0x0012 + * PTYPE_CARRIER 0x0014 + * PTYPE_AIR 0x0020 + * PTYPE_FIXEDWING 0x0021 + * PTYPE_HELO 0x0022 + * PTYPE_MISSILE 0x0040 + * PTYPE_SUBSURFACE 0x0080 + * PTYPE_SUBMARINE 0x0081 + * PTYPE_TORPEDO 0x0082 + * PTYPE_SONOBUOY 0x0084 + * PTYPE_FIXED 0x0100 + * PTYPE_AIRFIELD 0x0101 + * PTYPE_BALLISTIC 0x0200 + */ + bool tcPlatformInterface::IsEquippedForTargetType(unsigned int class_mask) + { + if (mpPlatformObj == 0) + { + wxASSERT(false); + return false; + } + size_t nLaunchers = mpPlatformObj->GetLauncherCount(); + for (size_t n=0; n<nLaunchers; n++) + { + tcLauncher* launcher = mpPlatformObj->GetLauncher(n); + wxASSERT(launcher != 0); + if (launcher->IsEffective(class_mask)) return true; + } + + return false; + } bool tcPlatformInterface::IsLauncherEffective(int anLauncher) *************** *** 854,859 **** void tcPlatformInterface::AddTask(const std::string& taskName, double priority, int attributes) { - if (mpPlatformObj->IsClientMode()) return; - ai::Brain* brain = mpPlatformObj->GetBrain(); wxASSERT(brain); --- 890,893 ---- Index: tcPlatformInterfaceExtensionB.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterfaceExtensionB.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** tcPlatformInterfaceExtensionB.cpp 16 Sep 2006 14:01:24 -0000 1.33 --- tcPlatformInterfaceExtensionB.cpp 24 Oct 2006 01:34:05 -0000 1.34 *************** *** 97,100 **** --- 97,101 ---- .def("HandoffTargetToLauncher", &tcPlatformInterface::HandoffTargetToLauncher) .def("IsLauncherEffective", &tcPlatformInterface::IsLauncherEffective) + .def("IsEquippedForTargetType", &tcPlatformInterface::IsEquippedForTargetType) .def("Launch", &tcPlatformInterface::Launch) .def("GetLauncherQuantity", &tcPlatformInterface::GetLauncherQuantity) Index: tcFlightPortInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcFlightPortInterface.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcFlightPortInterface.cpp 28 Sep 2006 02:01:53 -0000 1.12 --- tcFlightPortInterface.cpp 24 Oct 2006 01:34:05 -0000 1.13 *************** *** 83,87 **** ! void tcFlightPortInterface::AddCAPMission() { if (flightport == 0) return; --- 83,87 ---- ! void tcFlightPortInterface::AddCAPMission(float lon_rad, float lat_rad) { if (flightport == 0) return; *************** *** 90,94 **** tcCAPMission* cap = new tcCAPMission(); ! cap->SetStation(0, 0); missionManager->AddMission(cap); --- 90,94 ---- tcCAPMission* cap = new tcCAPMission(); ! cap->SetStation(lon_rad, lat_rad); missionManager->AddMission(cap); |