[Gcblue-commits] gcb_wx/src/scriptinterface tcPlatformInterface.cpp,1.21,1.22
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-05-24 00:14:58
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26112/src/scriptinterface Modified Files: tcPlatformInterface.cpp Log Message: Multiplayer changes Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcPlatformInterface.cpp 27 Apr 2004 22:18:52 -0000 1.21 --- tcPlatformInterface.cpp 24 May 2004 00:14:47 -0000 1.22 *************** *** 1,4 **** /* ! ** Copyright (C) 2003 Dewitt "Cole" Colclough (de...@tw...) ** All rights reserved. --- 1,4 ---- /* ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 40,43 **** --- 40,44 ---- #include "tcGenericDBObject.h" #include "tcLauncherState.h" + #include "tcLauncher.h" *************** *** 196,200 **** ! tcGameObject* tcPlatformInterface::GetTargetObj() { wxASSERT(mpSimState != NULL); return mpSimState->GetObject(GetTarget()); --- 197,202 ---- ! tcGameObject* tcPlatformInterface::GetTargetObj() ! { wxASSERT(mpSimState != NULL); return mpSimState->GetObject(GetTarget()); *************** *** 372,396 **** int nCount = GetLauncherCount(); ! if ((anLauncher < 0)||(anLauncher >= nCount)) { return false; } ! tsLData* pLauncherData = &mpPlatformObj->mcLauncherState.launchers[anLauncher]; tcMissileDBObject *pMissileDBObj = dynamic_cast<tcMissileDBObject*>(pLauncherData->mpChildDBObj); ! if (pMissileDBObj == NULL) { return false; // only missiles supported } info.mnLauncher = anLauncher; ! info.mnQuantity = pLauncherData->mnCurrent - pLauncherData->mnPending; info.mfRange_km = pMissileDBObj->mfRange_km; info.mnTargetFlags = pLauncherData->mnTargetFlags; ! if (pLauncherData->meLaunchMode == DATUM_ONLY) { info.mnLaunchMode = 0; } ! else if (pLauncherData->meLaunchMode == SEEKER_TRACK) { info.mnLaunchMode = 1; } ! else { info.mnLaunchMode = 2; // other } --- 374,403 ---- int nCount = GetLauncherCount(); ! if ((anLauncher < 0)||(anLauncher >= nCount)) ! { return false; } ! const tcLauncher* pLauncherData = mpPlatformObj->mcLauncherState.GetLauncher(anLauncher); tcMissileDBObject *pMissileDBObj = dynamic_cast<tcMissileDBObject*>(pLauncherData->mpChildDBObj); ! if (pMissileDBObj == NULL) ! { return false; // only missiles supported } info.mnLauncher = anLauncher; ! info.mnQuantity = pLauncherData->mnUncommitted; info.mfRange_km = pMissileDBObj->mfRange_km; info.mnTargetFlags = pLauncherData->mnTargetFlags; ! if (pLauncherData->meLaunchMode == DATUM_ONLY) ! { info.mnLaunchMode = 0; } ! else if (pLauncherData->meLaunchMode == SEEKER_TRACK) ! { info.mnLaunchMode = 1; } ! else ! { info.mnLaunchMode = 2; // other } *************** *** 399,425 **** } ! int tcPlatformInterface::GetLauncherCount(void) { ! if (mpPlatformObj == NULL) { return 0; } ! else { return mpPlatformObj->mcLauncherState.mnCount; } } ! std::string tcPlatformInterface::GetLauncherWeaponName(int anLauncher) { std::string s; int nCount = GetLauncherCount(); ! if ((anLauncher < 0)||(anLauncher >= nCount)) { ! s = "Error"; ! return s; ! } ! tcDatabaseObject *pChildDBObj = mpPlatformObj->mcLauncherState.launchers[anLauncher].mpChildDBObj; ! if (pChildDBObj == NULL) { s = "Error"; return s; } ! s = pChildDBObj->mzClass.mz; return s; } --- 406,434 ---- } ! int tcPlatformInterface::GetLauncherCount() ! { ! if (mpPlatformObj == NULL) ! { return 0; } ! else ! { return mpPlatformObj->mcLauncherState.mnCount; } } ! std::string tcPlatformInterface::GetLauncherWeaponName(int anLauncher) ! { std::string s; int nCount = GetLauncherCount(); ! if ((anLauncher < 0)||(anLauncher >= nCount)) ! { s = "Error"; return s; } ! ! s = mpPlatformObj->mcLauncherState.GetLauncherChildClass(anLauncher); ! return s; } *************** *** 729,734 **** int tcPlatformInterface::GetSensorCount() { ! std::vector<tcSensorState*> *pSS = mpPlatformObj->GetSensorStateArray(); ! return (int)pSS->size(); } --- 738,742 ---- int tcPlatformInterface::GetSensorCount() { ! return (int)mpPlatformObj->GetSensorCount(); } *************** *** 738,745 **** info.type = 0xFF; ! std::vector<tcSensorState*> *pSS = mpPlatformObj->GetSensorStateArray(); ! int nSensors = (int)pSS->size(); ! if ((n < 0)||(n >= nSensors)) return info; ! tcSensorState *sensor_state = pSS->at(n); info.isActive = sensor_state->GetActive(); if (dynamic_cast<tcRadarDBObject*>(sensor_state->mpDBObj)) --- 746,754 ---- info.type = 0xFF; ! ! unsigned nSensors = mpPlatformObj->GetSensorCount(); ! if ((n < 0)||((unsigned)n >= nSensors)) return info; ! ! const tcSensorState* sensor_state = mpPlatformObj->GetSensor(n); info.isActive = sensor_state->GetActive(); if (dynamic_cast<tcRadarDBObject*>(sensor_state->mpDBObj)) *************** *** 757,767 **** * @param anState 0 - all sensors off, 1 - all sensors on */ ! void tcPlatformInterface::SetAllSensorState(int anState) { ! std::vector<tcSensorState*> *pSS = mpPlatformObj->GetSensorStateArray(); ! int nSensors = (int)pSS->size(); ! for(int n=0;n<nSensors;n++) { ! tcSensorState *pSensorState = pSS->at(n); ! pSensorState->SetActive(anState); } } --- 766,776 ---- * @param anState 0 - all sensors off, 1 - all sensors on */ ! void tcPlatformInterface::SetAllSensorState(int anState) ! { ! unsigned nSensors = mpPlatformObj->GetSensorCount(); ! for(unsigned n=0;n<nSensors;n++) ! { ! mpPlatformObj->SetSensorState(n, anState != 0); } } *************** *** 769,777 **** void tcPlatformInterface::SetSensorState(int n, int state) { ! std::vector<tcSensorState*> *pSS = mpPlatformObj->GetSensorStateArray(); ! int nSensors = (int)pSS->size(); ! if ((n < 0)||(n >= nSensors)) return; ! tcSensorState *sensor_state = pSS->at(n); ! sensor_state->SetActive(state); } --- 778,782 ---- void tcPlatformInterface::SetSensorState(int n, int state) { ! mpPlatformObj->SetSensorState((unsigned)n, state != 0); } |