[Gcblue-commits] gcb_wx/src/scriptinterface tcPlatformInterface.cpp,1.34,1.35 tcPlatformInterfaceExt
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-02-18 17:41:59
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1814/src/scriptinterface Modified Files: tcPlatformInterface.cpp tcPlatformInterfaceExtension.cpp tcPlatformInterfaceExtensionB.cpp tcScenarioInterface.cpp Log Message: Parallel ai update Index: tcPlatformInterfaceExtensionB.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterfaceExtensionB.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcPlatformInterfaceExtensionB.cpp 5 Dec 2004 02:49:47 -0000 1.18 --- tcPlatformInterfaceExtensionB.cpp 18 Feb 2005 17:41:51 -0000 1.19 *************** *** 90,93 **** --- 90,94 ---- .def("GetLauncherWeaponName",&tcPlatformInterface::GetLauncherWeaponName) .def("GetBestLauncher",&tcPlatformInterface::GetBestLauncher) + .def("GetLauncherInfo", &tcPlatformInterface::GetLauncherInfoByValue) .def("SendDatumToLauncher", &tcPlatformInterface::SendDatumToLauncher) .def("HandoffTargetToLauncher", &tcPlatformInterface::HandoffTargetToLauncher) Index: tcPlatformInterfaceExtension.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterfaceExtension.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcPlatformInterfaceExtension.cpp 7 Dec 2004 04:00:41 -0000 1.12 --- tcPlatformInterfaceExtension.cpp 18 Feb 2005 17:41:51 -0000 1.13 *************** *** 120,123 **** --- 120,126 ---- .def_readonly("LaunchMode",&tcLauncherInfo::mnLaunchMode) // 0 - datum, 1 - handoff .def_readonly("MaxDepth_m",&tcLauncherInfo::maxDepth_m) + .def_readonly("SectorCenter", &tcLauncherInfo::sectorCenter) + .def_readonly("SectorWidth", &tcLauncherInfo::sectorWidth) + .def("IsValid", &tcLauncherInfo::IsValid) ; *************** *** 125,128 **** --- 128,132 ---- .def_readonly("isActive",&tcSensorInfo::isActive) .def_readonly("type",&tcSensorInfo::type) + .def("IsPassive", &tcSensorInfo::IsPassive) ; Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcScenarioInterface.cpp 16 Feb 2005 23:13:49 -0000 1.18 --- tcScenarioInterface.cpp 18 Feb 2005 17:41:51 -0000 1.19 *************** *** 228,232 **** for (int n=0;n<nOrders;n++) { ! platObj->mcAI.AddOrder(unit.orders[n]); } } --- 228,235 ---- for (int n=0;n<nOrders;n++) { ! /* a cobble to work with old system, use index as reverse priority (first order ! ** has max priority */ ! platObj->GetBrain()->AddTask(unit.orders[n].mstrOrdername, double(nOrders-n)); ! //platObj->mcAI.AddOrder(unit.orders[n]); } } Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** tcPlatformInterface.cpp 31 Jan 2005 01:33:08 -0000 1.34 --- tcPlatformInterface.cpp 18 Feb 2005 17:41:51 -0000 1.35 *************** *** 43,46 **** --- 43,47 ---- #include "tcBallisticDBObject.h" #include "tcGenericDBObject.h" + #include "tcSonarDBObject.h" #include "tcTorpedoDBObject.h" #include "tcLauncherState.h" *************** *** 455,462 **** } bool tcPlatformInterface::GetLauncherInfo(tcLauncherInfo& info, int anLauncher) { info.mnLauncher = -1; ! int nCount = GetLauncherCount(); if ((anLauncher < 0)||(anLauncher >= nCount)) --- 456,472 ---- } + tcLauncherInfo tcPlatformInterface::GetLauncherInfoByValue(int launcher) + { + tcLauncherInfo info; + + GetLauncherInfo(info, launcher); + + return info; + } + bool tcPlatformInterface::GetLauncherInfo(tcLauncherInfo& info, int anLauncher) { info.mnLauncher = -1; ! int nCount = GetLauncherCount(); if ((anLauncher < 0)||(anLauncher >= nCount)) *************** *** 464,468 **** return false; } ! const tcLauncher* pLauncherData = mpPlatformObj->mcLauncherState.GetLauncher(anLauncher); info.maxDepth_m = 0; --- 474,484 ---- return false; } ! ! const tcLauncher* const pLauncherData = mpPlatformObj->mcLauncherState.GetLauncher(anLauncher); ! wxASSERT(pLauncherData); ! ! // convert engagement sector values to degrees ! info.sectorCenter = C_180OVERPI * pLauncherData->GetSectorCenter(); ! info.sectorWidth = C_180OVERPI * pLauncherData->GetSectorWidth(); info.maxDepth_m = 0; *************** *** 982,991 **** const tcSensorState* sensor_state = mpPlatformObj->GetSensor(n); info.isActive = sensor_state->GetActive(); ! if (dynamic_cast<tcRadarDBObject*>(sensor_state->mpDBObj)) ! info.type = 0; ! else if (dynamic_cast<tcESMDBObject*>(sensor_state->mpDBObj)) info.type = 1; ! else ! info.type = 0xFF; return info; --- 998,1025 ---- const tcSensorState* sensor_state = mpPlatformObj->GetSensor(n); info.isActive = sensor_state->GetActive(); ! info.type = 0; ! ! if (sensor_state->IsRadar()) ! { info.type = 1; ! } ! else if (sensor_state->IsESM()) ! { ! info.type = 2; ! } ! else if (sensor_state->IsSonar()) ! { ! tcSonarDBObject* sonar = dynamic_cast<tcSonarDBObject*>(sensor_state->mpDBObj); ! if (sonar->isPassive) info.type += 4; ! if (sonar->isActive) info.type += 8; ! } ! else if (sensor_state->IsOptical()) ! { ! info.type = 16; ! } ! else // error ! { ! fprintf(stderr, "tcPlatformInterface::GetSensorInfo - bad sensor type\n"); ! } return info; |