[Gcblue-commits] gcb_wx/src/scriptinterface tcPlatformInterface.cpp,1.14,1.15
Status: Alpha
Brought to you by:
ddcforge
From: <ddc...@pr...> - 2004-02-01 22:21:06
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11210/src/scriptinterface Modified Files: tcPlatformInterface.cpp Log Message: Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcPlatformInterface.cpp 29 Jan 2004 00:05:23 -0000 1.14 --- tcPlatformInterface.cpp 1 Feb 2004 22:19:09 -0000 1.15 *************** *** 39,42 **** --- 39,43 ---- #include "tcAeroAirObject.h" #include "tcGenericDBObject.h" + #include "tcLauncherState.h" *************** *** 416,420 **** void tcPlatformInterface::Launch(int anLauncher, int quantity) { ! mpPlatformObj->SetLaunch(anLauncher, quantity); } --- 417,426 ---- void tcPlatformInterface::Launch(int anLauncher, int quantity) { ! int launcherStatus = mpPlatformObj->SetLaunch(anLauncher, quantity); ! if (launcherStatus != tcLauncherState::LAUNCHER_READY) ! { ! ! DisplayMessage(tcLauncherState::TranslateLauncherStatus(launcherStatus)); ! } } *************** *** 735,741 **** // print message to user console ! void tcPlatformInterface::DisplayMessage(std::string text) { ! if (mpConsole == NULL) {return;} ! mpConsole->Print(text.c_str()); } --- 741,750 ---- // print message to user console ! void tcPlatformInterface::DisplayMessage(std::string text) ! { ! wxASSERT(mpConsole); ! ! if (isPlatformOwnAlliance) mpConsole->Print(text.c_str()); ! } *************** *** 765,768 **** --- 774,801 ---- } + void tcPlatformInterface::GetLocalObj(void) + { + wxASSERT(mpSimState); + + mpPlatformObj = mpStaticPlatformObj; + GetSensorMap(); + isPlatformOwnAlliance = (mpPlatformObj) ? + (mpSimState->mpUserInfo->IsOwnAlliance(mpPlatformObj->mnAlliance) != 0) : false; + } + + /** + * This method directly sets local obj + */ + void tcPlatformInterface::SetPlatform(tcPlatformObject *obj) + { + wxASSERT(mpSimState); + + mpPlatformObj = obj; + GetSensorMap(); + isPlatformOwnAlliance = (mpPlatformObj) ? + (mpSimState->mpUserInfo->IsOwnAlliance(mpPlatformObj->mnAlliance) != 0) : false; + } + + tcPlatformObject* tcPlatformInterface::mpStaticPlatformObj = NULL; tcSimState* tcPlatformInterface::mpSimState = NULL; |