[Gcblue-commits] gcb_wx/include/sim tcControllableObject.h,1.1,1.2 tcGoal.h,1.5,1.6 tcGoalTracker.h,
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-07-26 00:37:50
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13788/include/sim Modified Files: tcControllableObject.h tcGoal.h tcGoalTracker.h tcSensorMapTrack.h tcSimState.h tcSubObject.h Log Message: Added mission goal status to "Mission" channel (hit F7), added sub periscope and mast ops to multiplayer, changed torpedo behavior to resume s-search if track lost early, made afterburner smoke thin a little more uniformly Index: tcGoal.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGoal.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcGoal.h 22 Jun 2005 01:21:27 -0000 1.5 --- tcGoal.h 26 Jul 2005 00:37:03 -0000 1.6 *************** *** 62,66 **** bool IsUnresolved() {return goalState == UNRESOLVED;} virtual void Update(); ///< updates goal state using on simState ! virtual void WriteStatus(std::stringstream& stream); virtual tcGoal* Clone(); --- 62,66 ---- bool IsUnresolved() {return goalState == UNRESOLVED;} virtual void Update(); ///< updates goal state using on simState ! virtual void WriteStatus(std::stringstream& stream, unsigned int level = 0); virtual tcGoal* Clone(); *************** *** 68,71 **** --- 68,73 ---- tcGoal(const tcGoal& goal); virtual ~tcGoal(); + protected: + const std::string indentString; }; *************** *** 88,92 **** void SetLogic(int logic) {logicType = logic;} virtual void Update(); ///< updates goal state using on simState ! virtual void WriteStatus(std::stringstream& stream); virtual tcGoal* Clone(); --- 90,94 ---- void SetLogic(int logic) {logicType = logic;} virtual void Update(); ///< updates goal state using on simState ! virtual void WriteStatus(std::stringstream& stream, unsigned int level = 0); virtual tcGoal* Clone(); *************** *** 108,112 **** void SetPassTimeout(double t) {passTimeout = t;} virtual void Update(); ///< updates goal state using on simState ! virtual void WriteStatus(std::stringstream& stream); virtual tcGoal* Clone(); --- 110,114 ---- void SetPassTimeout(double t) {passTimeout = t;} virtual void Update(); ///< updates goal state using on simState ! virtual void WriteStatus(std::stringstream& stream, unsigned int level = 0); virtual tcGoal* Clone(); *************** *** 125,129 **** virtual void Update(); ! virtual void WriteStatus(std::stringstream& stream); virtual tcGoal* Clone(); --- 127,131 ---- virtual void Update(); ! virtual void WriteStatus(std::stringstream& stream, unsigned int level = 0); virtual tcGoal* Clone(); *************** *** 132,135 **** --- 134,153 ---- }; + /** + * goal to protect specific unit + */ + class tcProtectGoal : public tcGoal + { + public: + std::string targetString; + + virtual void Update(); + virtual void WriteStatus(std::stringstream& stream, unsigned int level = 0); + + virtual tcGoal* Clone(); + tcProtectGoal(const tcProtectGoal& goal); + tcProtectGoal(std::string s) : targetString(s) {} + }; + Index: tcSubObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSubObject.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcSubObject.h 14 Jul 2005 23:41:50 -0000 1.9 --- tcSubObject.h 26 Jul 2005 00:37:03 -0000 1.10 *************** *** 86,89 **** --- 86,99 ---- virtual ~tcSubObject(); protected: + enum + { + MAST_CMD = 0x01 ///< flag for periscope, radar mast, or snorkeling cmds + }; + enum + { + PERISCOPE = 0x01, + RADARMAST = 0x02, + SNORKEL = 0x04 + }; tcCommandObject commandObj; const float maxPitch_rad; Index: tcGoalTracker.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGoalTracker.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcGoalTracker.h 6 Sep 2004 01:08:03 -0000 1.3 --- tcGoalTracker.h 26 Jul 2005 00:37:03 -0000 1.4 *************** *** 6,14 **** #define _GOALTRACKER_H_ - #include <vector> #include <map> class tcGoal; class tcGoalTracker { --- 6,20 ---- #define _GOALTRACKER_H_ #include <map> + #include <sstream> + #include <vector> + class tcStream; + class tcCommandStream; + class tcCreateStream; + class tcUpdateStream; class tcGoal; + class tcGoalTracker { *************** *** 21,24 **** --- 27,31 ---- void Clear(); + const std::string& GetAllianceGoalStatusDescription(int alliance); bool HasAllianceFailed(int alliance); bool HasAllianceSucceeded(int alliance); *************** *** 29,38 **** void WriteStatus(std::stringstream& stream, int alliance); tcGoalTracker(); ~tcGoalTracker(); ! private: double lastUpdateTime; const double updateInterval; ///< game time between updates std::map<int, int> previousGoalStatus; ///< status at last update }; --- 36,56 ---- void WriteStatus(std::stringstream& stream, int alliance); + tcUpdateStream& operator<<(tcUpdateStream& stream); + tcUpdateStream& operator>>(tcUpdateStream& stream); + + static tcGoalTracker* Get(); + private: tcGoalTracker(); ~tcGoalTracker(); ! double lastUpdateTime; const double updateInterval; ///< game time between updates std::map<int, int> previousGoalStatus; ///< status at last update + + // variables for multiplayer client + std::string goalStatusDescription; ///< for client alliance only + bool allianceFailed; ///< true if client alliance has failed + bool allianceSucceeded; ///< true if client alliance has succeeded + bool statusChanged; ///< true if allianceFailed or allianceSucceeded has changed }; Index: tcSimState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSimState.h,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** tcSimState.h 22 Jun 2005 01:21:27 -0000 1.42 --- tcSimState.h 26 Jul 2005 00:37:03 -0000 1.43 *************** *** 125,129 **** tcGameObject* CreateGameObject(tcDatabaseObject *apDBObject); tcGameObject* CreateRandomPlatform(UINT platform_type); ! void DeleteAllPlatforms(void); void DeleteObject(long key); void DesignateTarget(long anKey, long anTargetKey); --- 125,129 ---- tcGameObject* CreateGameObject(tcDatabaseObject *apDBObject); tcGameObject* CreateRandomPlatform(UINT platform_type); ! void DeleteAllPlatforms(); void DeleteObject(long key); void DesignateTarget(long anKey, long anTargetKey); *************** *** 137,141 **** void GetDateZulu(DateZulu& dz) {dz = dateZulu;} void GetDescription(long anKey, tcString& s); - tcGoalTracker* GetGoalTracker() {return goalTracker;} void GetNextPlatform(tnPoolIndex& pos, tnPoolIndex& key, tcGameObject*& obj) { --- 137,140 ---- *************** *** 171,175 **** void RandInit(); ! void RemoveDestroyedObjects(void); void RequestLaunch(long anKey,int anLauncher); void SaveTimeToStream(tcStream& stream); --- 170,174 ---- void RandInit(); ! void RemoveDestroyedObjects(); void RequestLaunch(long anKey,int anLauncher); void SaveTimeToStream(tcStream& stream); Index: tcControllableObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcControllableObject.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcControllableObject.h 6 May 2005 23:57:16 -0000 1.1 --- tcControllableObject.h 26 Jul 2005 00:37:03 -0000 1.2 *************** *** 72,75 **** --- 72,76 ---- static void AttachUserInfo(); + static void SetSinglePlayerMode(bool state); tcControllableObject(); *************** *** 82,85 **** --- 83,87 ---- static tcUserInfo* userInfo; + static bool singlePlayerMode; ///< bypass control check in single play }; Index: tcSensorMapTrack.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorMapTrack.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcSensorMapTrack.h 28 Jun 2005 02:51:20 -0000 1.3 --- tcSensorMapTrack.h 26 Jul 2005 00:37:03 -0000 1.4 *************** *** 61,65 **** double mfStartTime; ///< birth time of track from report long mnTrackID; - long trackDatabaseID; ///< database id of track (usually from visual ident), -1 is unknown long mnSensorPlatformID; ///< id of contributing sensor UINT8 mnFlags; --- 61,64 ---- *************** *** 105,109 **** tsEmitterInfo maEmitterInfo[MAX_EMITTERS]; int mnEmitters; - long mnDatabaseID; ///< database ID of track, -1 for unknown float assessedDamage; std::vector<long> intercepts; ///< vector of platform ids that are intercepting this track --- 104,107 ---- *************** *** 142,145 **** --- 140,144 ---- unsigned GetContributorCount() const; const char* GetContributorName(unsigned idx) const; + long GetDatabaseId() const; tc3DModel* GetModel() const; *************** *** 187,191 **** --- 186,192 ---- enum {TRACK_STALE = 1, TRACK_DESTROYED = 2}; unsigned char sensorFlags; ///< 1 - stale, 2 - destroyed + long mnDatabaseID; ///< database ID of track, -1 for unknown tc3DModel* model; + void KillAssess(); }; |