[Gcblue-commits] gcb_wx/src/scriptinterface tcFlightPortInterface.cpp, 1.10, 1.11 tcPlatformInterfa
Status: Alpha
Brought to you by:
ddcforge
From: Dewitt C. <ddc...@us...> - 2006-08-17 01:28:07
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv21820/src/scriptinterface Modified Files: tcFlightPortInterface.cpp tcPlatformInterface.cpp tcPlatformInterfaceExtensionB.cpp tcScenarioInterface.cpp Log Message: Update for server name change Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** tcScenarioInterface.cpp 18 Jun 2006 00:45:01 -0000 1.42 --- tcScenarioInterface.cpp 17 Aug 2006 01:28:04 -0000 1.43 *************** *** 1050,1054 **** { simState->Clear(); ! database::tcDatabase::Get()->Clear(); } --- 1050,1054 ---- { simState->Clear(); ! database::tcDatabase::Get()->SerializeSql("", true); // reload default database } Index: tcFlightPortInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcFlightPortInterface.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcFlightPortInterface.cpp 18 Jun 2006 00:45:01 -0000 1.10 --- tcFlightPortInterface.cpp 17 Aug 2006 01:28:04 -0000 1.11 *************** *** 31,34 **** --- 31,35 ---- #include <string> #include "tcFlightPortInterface.h" + #include "tcPlatformInterface.h" #include "tcSimState.h" #include "simmath.h" *************** *** 64,67 **** --- 65,69 ---- .def("GetUnitLocation", &tcFlightPortInterface::GetUnitLocation) .def("GetUnitGoalLocation", &tcFlightPortInterface::GetUnitGoalLocation) + .def("GetUnitPlatformInterface", &tcFlightPortInterface::GetUnitPlatformInterface) .def("IsValid", &tcFlightPortInterface::IsValid) .def("Launch", &tcFlightPortInterface::Launch) *************** *** 154,157 **** --- 156,169 ---- } + tcPlatformInterface tcFlightPortInterface::GetUnitPlatformInterface(int n) + { + if ((n<0)||(n>=(int)flightport->units.size())) return tcPlatformInterface(0); + + tcAirState* airstate = flightport->units[n]; + wxASSERT(airstate != 0); + tcPlatformObject *obj = dynamic_cast<tcPlatformObject*>(airstate->obj); + return tcPlatformInterface(obj); + } + bool tcFlightPortInterface::IsValid() { Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** tcPlatformInterface.cpp 18 Jun 2006 00:45:01 -0000 1.61 --- tcPlatformInterface.cpp 17 Aug 2006 01:28:04 -0000 1.62 *************** *** 721,725 **** * */ ! void tcPlatformInterface::LoadLauncher(int anLauncher, std::string item) { if (!mpPlatformObj->IsControlled()) return; --- 721,725 ---- * */ ! void tcPlatformInterface::LoadLauncher(int anLauncher, const std::string& item) { if (!mpPlatformObj->IsControlled()) return; *************** *** 748,751 **** --- 748,788 ---- } + + void tcPlatformInterface::LoadOther(const std::string& item) + { + if (!mpPlatformObj->IsControlled()) return; + + size_t nMagazines = mpPlatformObj->GetMagazineCount(); + for (size_t n=0; n<nMagazines; n++) + { + tcStores* mag = mpPlatformObj->GetMagazine(n); + if (mag->CurrentItemQuantity(item)) + { + mag->LoadOther(item, mpPlatformObj); + return; + } + } + + if (tcPlatformObject* parent = dynamic_cast<tcPlatformObject*>(mpPlatformObj->parent)) + { + size_t nMagazines = parent->GetMagazineCount(); + for (size_t n=0; n<nMagazines; n++) + { + tcStores* mag = parent->GetMagazine(n); + if (mag->CurrentItemQuantity(item)) + { + mag->LoadOther(item, mpPlatformObj); + return; + } + } + } + } + + + bool tcPlatformInterface::IsRefueling() const + { + return mpPlatformObj->IsRefueling(); + } + /** * *************** *** 1603,1608 **** } ! mpSensorMap = mpSimState->mcSensorMap.GetMap(mpPlatformObj->GetAlliance()); ! wxASSERT(mpSensorMap); } --- 1640,1645 ---- } ! mpSensorMap = (mpPlatformObj != 0) ? mpSimState->mcSensorMap.GetMap(mpPlatformObj->GetAlliance()) : 0; ! } Index: tcPlatformInterfaceExtensionB.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterfaceExtensionB.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** tcPlatformInterfaceExtensionB.cpp 18 Jun 2006 00:45:01 -0000 1.31 --- tcPlatformInterfaceExtensionB.cpp 17 Aug 2006 01:28:04 -0000 1.32 *************** *** 37,40 **** --- 37,41 ---- #include "tcSoundConsole.h" #include "ai/BlackboardInterface.h" + #include "tcFlightPortInterface.h" #ifdef _DEBUG *************** *** 106,110 **** .def("LoadLauncher", &tcPlatformInterface::LoadLauncher) .def("UnloadLauncher", &tcPlatformInterface::UnloadLauncher) ! // task interface commands --- 107,112 ---- .def("LoadLauncher", &tcPlatformInterface::LoadLauncher) .def("UnloadLauncher", &tcPlatformInterface::UnloadLauncher) ! .def("LoadOther", &tcPlatformInterface::LoadOther) ! .def("IsRefueling", &tcPlatformInterface::IsRefueling) // task interface commands *************** *** 142,145 **** --- 144,148 ---- .def("SetLandingState",&tcPlatformInterface::SetLandingState) .def("HasFlightPort",&tcPlatformInterface::HasFlightPort) + .def("GetFlightPortInfo",&tcPlatformInterface::GetFlightPortInfo) .def("GetLandingData", &tcPlatformInterface::GetLandingData) .def("GetUserInput",&tcPlatformInterface::GetUserInput) |