[Gcblue-commits] gcb_wx/include/sim tcStores.h,NONE,1.1 tcLauncher.h,1.4,1.5 tcLauncherState.h,1.10,
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-11-29 03:55:01
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21010/include/sim Modified Files: tcLauncher.h tcLauncherState.h tcObjectControl.h tcPlatformObject.h Added Files: tcStores.h Log Message: Magazine class tcStores and related Index: tcLauncher.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncher.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcLauncher.h 5 Aug 2004 02:22:35 -0000 1.4 --- tcLauncher.h 29 Nov 2004 03:54:49 -0000 1.5 *************** *** 87,94 **** bool CommandInfoMatches(const tcLauncher& launcher); void CopyCommandInfoFrom(const tcLauncher& launcher); ! float GetCycleTime() const; int GetErrorCode() const {return errorCode;} void SetErrorCode(int code) {errorCode = code;} }; #endif \ No newline at end of file --- 87,101 ---- bool CommandInfoMatches(const tcLauncher& launcher); void CopyCommandInfoFrom(const tcLauncher& launcher); ! std::string GetChildClassName() const; float GetCycleTime() const; int GetErrorCode() const {return errorCode;} void SetErrorCode(int code) {errorCode = code;} + void SetChildClass(const std::string& childClass); + unsigned int GetCompatibleCount() const; + std::string GetCompatibleName(unsigned int idx) const; + tcLauncher(); + tcLauncher(tcLauncherDBObject* dbObj); + ~tcLauncher(); + }; #endif \ No newline at end of file --- NEW FILE: tcStores.h --- /** ** @file tcStores.h */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _TCSTORES_H_ #define _TCSTORES_H_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include <vector> namespace Database { class tcStoresDBObject; } using namespace Database; class tcPlatformObject; class tcStream; class tcCommandStream; class tcCreateStream; class tcUpdateStream; /** * State for stores object, used for weapons magazines for subs */ class tcStores { public: class StoreItem { public: std::string className; unsigned int quantity; StoreItem(); StoreItem(const StoreItem& src); StoreItem(const std::string& name, unsigned int qty); }; struct StoreOperation { enum {UNLOAD = 0, LOAD = 1}; std::string item; ///< item type to transfer unsigned int quantity; ///< quantity of item float timeToComplete; ///< time left for op to complete [s] unsigned int launcherIdx; ///< launcher idx to transfer to/from int transferType; ///< UNLOAD or LOAD }; bool AddItems(const std::string& item, unsigned int quantity); unsigned int CurrentItemQuantity(const std::string& item) const; unsigned int CurrentQuantity() const; bool IsCompatible(const std::string& item) const; bool IsFull() const; bool LoadLauncher(unsigned int idx, const std::string& item); void SetParent(tcPlatformObject* obj); bool UnloadLauncher(unsigned int idx); void Update(double t); tcCommandStream& operator<<(tcCommandStream& stream); tcCreateStream& operator<<(tcCreateStream& stream); tcUpdateStream& operator<<(tcUpdateStream& stream); tcCommandStream& operator>>(tcCommandStream& stream); tcCreateStream& operator>>(tcCreateStream& stream); tcUpdateStream& operator>>(tcUpdateStream& stream); bool CommandInfoMatches(const tcStores& launcher); void CopyCommandInfoFrom(const tcStores& launcher); tcStores(tcStoresDBObject* dbObj); virtual ~tcStores(); private: tcStoresDBObject* storesDBObj; tcPlatformObject* parent; std::vector<StoreItem> stores; std::vector<StoreOperation> ops; int errorCode; ///< used in multiplayer to pass error code to client double lastUpdate; void CompleteOperation(StoreOperation& op); }; #endif Index: tcObjectControl.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcObjectControl.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcObjectControl.h 23 Nov 2004 23:30:49 -0000 1.9 --- tcObjectControl.h 29 Nov 2004 03:54:49 -0000 1.10 *************** *** 127,131 **** bool ButtonContainingPoint(wxPoint point, int& rnRow, int& rnColumn); void GetRect(tcRect& r); ! void SetCaption(char *caption, unsigned row, unsigned button); tcButtonPanel(); ~tcButtonPanel(); --- 127,132 ---- bool ButtonContainingPoint(wxPoint point, int& rnRow, int& rnColumn); void GetRect(tcRect& r); ! void SetCaption(const char *caption, unsigned row, unsigned button); ! tcButtonPanel(); ~tcButtonPanel(); Index: tcLauncherState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncherState.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcLauncherState.h 23 Nov 2004 23:30:49 -0000 1.10 --- tcLauncherState.h 29 Nov 2004 03:54:49 -0000 1.11 *************** *** 124,128 **** private: ! std::vector<tcLauncher> launchers; ///< vector of launcher state info tcCommandObject commandObj; static tcSimState *simState; --- 124,128 ---- private: ! std::vector<tcLauncher*> launchers; ///< vector of launcher state info tcCommandObject commandObj; static tcSimState *simState; Index: tcPlatformObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcPlatformObject.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcPlatformObject.h 6 Sep 2004 01:08:03 -0000 1.20 --- tcPlatformObject.h 29 Nov 2004 03:54:49 -0000 1.21 *************** *** 39,42 **** --- 39,43 ---- class tcCreateStream; class tcUpdateStream; + class tcStores; namespace Database *************** *** 72,75 **** --- 73,78 ---- //tcSensorState* mapSensorState[MAXSENSORS]; std::vector<tcSensorState*> mapSensorState; + std::vector<tcStores*> magazines; + //int mnSensors; tcGuidanceState mcGS; *************** *** 94,98 **** virtual void GetLauncherState(tcLauncherState*& pLauncherState) {pLauncherState=&mcLauncherState;} ! unsigned GetSensorCount() const; // virtual void GetSensorState(tcSensorState** aapSensorState, int& rnCount); // virtual void GetSensorStateRef(tcSensorState**& rapSensorState, int& rnCount); --- 97,105 ---- virtual void GetLauncherState(tcLauncherState*& pLauncherState) {pLauncherState=&mcLauncherState;} ! unsigned int GetMagazineCount() const; ! tcStores* GetMagazine(unsigned int idx); ! unsigned int GetMagazineQuantity(const std::string& item); ! ! unsigned int GetSensorCount() const; // virtual void GetSensorState(tcSensorState** aapSensorState, int& rnCount); // virtual void GetSensorStateRef(tcSensorState**& rapSensorState, int& rnCount); *************** *** 148,151 **** --- 155,159 ---- virtual void UpdateHeading(float dt_s); virtual void UpdateLauncherState(float dt_s); + virtual void UpdateMagazines(double t); virtual void UpdateSensors(double t); virtual void UpdateSpeed(float dt_s); |