[Gcblue-commits] gcb_wx/include/sim tcSensorMap.h,1.10,1.11 tcSensorState.h,1.14,1.15 tcSimState.h,1
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-03-02 22:29:27
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15614/include/sim Modified Files: tcSensorMap.h tcSensorState.h tcSimState.h Log Message: Better sensor ageout behavior, more ai work, misc cleanup Index: tcSimState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSimState.h,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** tcSimState.h 24 Feb 2005 22:19:14 -0000 1.33 --- tcSimState.h 2 Mar 2005 22:28:40 -0000 1.34 *************** *** 66,69 **** --- 66,70 ---- class tcMissileObject; class tcTorpedoObject; + class tcPositionRegistry; #define N_GAME_OBJECTS 1024 *************** *** 148,152 **** int GetPlatformState(long anKey, tcGameObject*& pplat); tcGameObject* GetObject(tnPoolIndex anKey); ! tcGameObject* GetObjectByName(std::string unitName); int GetPlatformsWithinRegion(tnPoolIndex *apKeyList, int anLength, tcRect *apRegion); long GetRandomPlatform(); --- 149,153 ---- int GetPlatformState(long anKey, tcGameObject*& pplat); tcGameObject* GetObject(tnPoolIndex anKey); ! tcGameObject* GetObjectByName(const std::string& unitName); int GetPlatformsWithinRegion(tnPoolIndex *apKeyList, int anLength, tcRect *apRegion); long GetRandomPlatform(); *************** *** 195,198 **** --- 196,201 ---- MultiplayerMode multiplayerMode; ///< multiplayer mode, default = MM_OFF long timeAcceleration; ///< 0 - paused, 1 - normal, N - Nx accelerated time + std::map<std::string, long> objectNameMap; ///< for fast lookup by object name + tcPositionRegistry* positionRegistry; ///< for fast(er) lookup by region void EvaluateGuidedMissileHit(tcMissileObject* missile, tcGameObject* target); *************** *** 206,209 **** --- 209,213 ---- void ProcessESMDetection(tcGameObject *apESMPlat,tcGameObject *apTarget, tcESMSensor *apESMSS); + void RegisterPlatform(tcGameObject* obj); void ReportDamage(tcGameObject* obj); void UpdateFireControl(tcGameObject *apGameObj, tcRadar *apRadarSS); Index: tcSensorMap.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorMap.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcSensorMap.h 6 Nov 2004 15:13:40 -0000 1.10 --- tcSensorMap.h 2 Mar 2005 22:28:39 -0000 1.11 *************** *** 1,4 **** ! /* ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,7 ---- ! /** ! ** @file tcSensorMap.h ! ** TODO needs cleanup, this area is a mess ! */ ! /* Copyright (C) 2003-2005 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 99,105 **** { enum {MAX_SENSOR_REPORTS = 2, MAX_EMITTERS = 4}; public: - //tcTrack track; - double mfLastUpdateTime; tcSensorReport maSensorReport[MAX_SENSOR_REPORTS]; ///< most recent data from contributing sensors int mnContributors; --- 102,107 ---- { enum {MAX_SENSOR_REPORTS = 2, MAX_EMITTERS = 4}; + public: tcSensorReport maSensorReport[MAX_SENSOR_REPORTS]; ///< most recent data from contributing sensors int mnContributors; *************** *** 107,113 **** int mnEmitters; long mnDatabaseID; ///< database ID of track, -1 for unknown ! float matchupRating; ///< matchup rating for platforms that have targeted this track ! float expectedDamage; ///< rating of expected fractional damage of weapons launched at target, 0 - none, 1.0 - totally destroyed ! float assessedDamage; ///< fractional damage assessment std::vector<long> intercepts; ///< vector of platform ids that are intercepting this track std::vector<long> engaged; ///< vector of weapon ids that are tracking / engaging --- 109,113 ---- 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 std::vector<long> engaged; ///< vector of weapon ids that are tracking / engaging *************** *** 122,125 **** --- 122,126 ---- bool AddReport(const tcSensorReport& report); + void RemoveReport(int n); ///< static method to set pointer to tcSimState object *************** *** 144,148 **** const tcTrack* GetTrack() {return this;} bool IsNew() {return mfTimestamp == 0;} ! bool UpdateActiveReport(tcSensorReport*& rpReport, tnPoolIndex anSensorID); --- 145,153 ---- const tcTrack* GetTrack() {return this;} bool IsNew() {return mfTimestamp == 0;} ! bool IsDestroyed() const; ! bool IsStale() const; ! void MarkDestroyed(); ! void MarkStale(); ! void ClearStale(); bool UpdateActiveReport(tcSensorReport*& rpReport, tnPoolIndex anSensorID); *************** *** 170,178 **** ~tcSensorMapTrack(); ! void RemoveReport(int n); ! private: static tcSimState* simState; static tcDatabase* database; }; --- 175,187 ---- ~tcSensorMapTrack(); ! static void SetAutoKillAssess(bool state); private: static tcSimState* simState; static tcDatabase* database; + static bool autoKillAssess; ///< set to true to automatically mark destroyed tracks + enum {TRACK_STALE = 1, TRACK_DESTROYED = 2}; + unsigned int sensorFlags; ///< 1 - stale, 2 - destroyed + + void KillAssess(); }; *************** *** 212,215 **** --- 221,226 ---- double lastEngagementsUpdate; const unsigned int alliance; + float ageOutTime; ///< time to drop track + float staleTime; ///< time to indicate track as stale }; Index: tcSensorState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorState.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcSensorState.h 24 Feb 2005 22:19:14 -0000 1.14 --- tcSensorState.h 2 Mar 2005 22:28:40 -0000 1.15 *************** *** 39,48 **** using Database::tcSensorDBObject; ! #define SSMODE_SURVEILLANCE 1 #define SSMODE_SEEKERTRACK 2 ///< seeker is tracking target #define SSMODE_SEEKERSEARCH 3 ///< seeker searching for target #define SSMODE_SEEKERACQUIRE 4 ///< seeker has target cue and attempting to track #define SSMODE_FC 5 // fire control only - #define SSMODE_FCSURVEILLANCE 6 // both class tcSimState; --- 39,47 ---- using Database::tcSensorDBObject; ! #define SSMODE_SURVEILLANCE 1 ///< surveillance or both FC and surveillance #define SSMODE_SEEKERTRACK 2 ///< seeker is tracking target #define SSMODE_SEEKERSEARCH 3 ///< seeker searching for target #define SSMODE_SEEKERACQUIRE 4 ///< seeker has target cue and attempting to track #define SSMODE_FC 5 // fire control only class tcSimState; |