X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAIModel%2FAIMultiplayer.hxx;h=4c8d50a001d086f237fc4d2ac8ed8f58076ac48b;hb=3f3755fda27e40596d5e418ade89091aee7f00bc;hp=406b00c6ee2ced5c4d7fe0c30852d5f0a5fcfb42;hpb=c9813d1b5d79b4aad13c263690a0223086af25ac;p=flightgear.git diff --git a/src/AIModel/AIMultiplayer.hxx b/src/AIModel/AIMultiplayer.hxx old mode 100755 new mode 100644 index 406b00c6e..4c8d50a00 --- a/src/AIModel/AIMultiplayer.hxx +++ b/src/AIModel/AIMultiplayer.hxx @@ -31,20 +31,15 @@ class FGAIMultiplayer : public FGAIBase { public: FGAIMultiplayer(); virtual ~FGAIMultiplayer(); - - virtual bool init(); + + virtual bool init(bool search_in_AI_path=false); virtual void bind(); virtual void unbind(); virtual void update(double dt); - - void addMotionInfo(const FGExternalMotionData& motionInfo, long stamp); + + void addMotionInfo(FGExternalMotionData& motionInfo, long stamp); void setDoubleProperty(const std::string& prop, double val); - - void setCallSign(const string& callSign) - { mCallSign = callSign; } - const char* getCallSign(void) const - { return mCallSign.c_str(); } - + long getLastTimestamp(void) const { return mLastTimestamp; } @@ -64,6 +59,9 @@ public: void addPropertyId(unsigned id, const char* name) { mPropertyMap[id] = props->getNode(name, true); } + SGPropertyNode* getPropertyRoot() + { return props; } + virtual const char* getTypeString(void) const { return "multiplayer"; } private: @@ -71,22 +69,27 @@ private: // Automatic sorting of motion data according to its timestamp typedef std::map MotionInfo; MotionInfo mMotionInfo; - + // Map between the property id's from the multiplayers network packets // and the property nodes typedef std::map > PropertyMap; PropertyMap mPropertyMap; - std::string mCallSign; - double mTimeOffset; bool mTimeOffsetSet; - + + double lastUpdateTime; + /// Properties which are for now exposed for testing bool mAllowExtrapolation; double mLagAdjustSystemSpeed; long mLastTimestamp; + + // Propertiies for tankers + SGPropertyNode_ptr refuel_node; + bool isTanker; + bool contact; // set if this tanker is within fuelling range }; #endif // _FG_AIMultiplayer_HXX