[Gcblue-commits] gcb_wx/src/sim Game.cpp, 1.160, 1.161 tcFlightPort.cpp, 1.28, 1.29 tcPlatformObjec
Status: Alpha
Brought to you by:
ddcforge
From: Dewitt C. <ddc...@us...> - 2006-10-01 21:07:45
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6071/src/sim Modified Files: Game.cpp tcFlightPort.cpp tcPlatformObject.cpp tcStores.cpp Log Message: Airbase automation updates Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** tcPlatformObject.cpp 28 Sep 2006 02:01:53 -0000 1.64 --- tcPlatformObject.cpp 1 Oct 2006 21:07:41 -0000 1.65 *************** *** 585,588 **** --- 585,603 ---- /** + * @return true if all launchers full and not loading + */ + bool tcPlatformObject::AllLaunchersFull() + { + size_t nLaunchers = GetLauncherCount(); + for (size_t n=0; n<nLaunchers; n++) + { + tcLauncher* launcher = GetLauncher(n); + if ((launcher->IsLoading()) || (launcher->mnCurrent < launcher->capacity)) return false; + } + + return true; + } + + /** * @return true if fully equipped, done loading, and at least one * launcher is effective vs. target type *************** *** 723,726 **** --- 738,749 ---- + bool tcPlatformObject::IsReadyForLaunch() + { + bool fullyFueled = (fuel_kg >= mpDBObject->mfFuelCapacity_kg) && (!isRefueling); + bool launchersLoaded = AllLaunchersFull(); + + return fullyFueled && launchersLoaded; + } + bool tcPlatformObject::IsRefueling() const { Index: tcStores.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcStores.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcStores.cpp 6 Sep 2006 01:28:20 -0000 1.13 --- tcStores.cpp 1 Oct 2006 21:07:41 -0000 1.14 *************** *** 302,305 **** --- 302,309 ---- temp.push_back(automationOps[n]); } + else if (automationOps[n].type == type) + { + return; // op already exists, don't add again + } } automationOps = temp; Index: tcFlightPort.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightPort.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tcFlightPort.cpp 28 Sep 2006 02:01:53 -0000 1.28 --- tcFlightPort.cpp 1 Oct 2006 21:07:41 -0000 1.29 *************** *** 625,629 **** } ! int tcFlightPort::GetAirStateIdx(long id) { size_t nUnits = units.size(); --- 625,629 ---- } ! int tcFlightPort::GetAirStateIdx(long id) const { size_t nUnits = units.size(); *************** *** 927,930 **** --- 927,951 ---- /** + * @return true if unit matching id is queued for takeoff + * (goal loc == TAKEOFF) + */ + bool tcFlightPort::IsQueuedForTakeoff(long id) const + { + int idx = GetAirStateIdx(id); + if (idx < 0) return false; + + const tcAirState* airState = GetAirState((unsigned)idx); + if (airState != 0) + { + return (airState->goal_location == TAKEOFF); + } + else + { + wxASSERT(false); + return false; + } + } + + /** * Use to check status of specific spot, e.g. runway 1 * @return true if spot is empty, hangar spot is empty if hangar is not full Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.160 retrieving revision 1.161 diff -C2 -d -r1.160 -r1.161 *** Game.cpp 24 Sep 2006 19:50:20 -0000 1.160 --- Game.cpp 1 Oct 2006 21:07:41 -0000 1.161 *************** *** 795,799 **** startView->AttachOptions(tcOptions::Get()); ! startView->LoadBackgroundImage("start_background.jpg"); // start_background_dev.jpg if (startView->Init() == false) --- 795,799 ---- startView->AttachOptions(tcOptions::Get()); ! startView->LoadBackgroundImage("start_background_dev.jpg"); // start_background.jpg if (startView->Init() == false) |