NetworkPriority.pkg 1.2 KB

123456789101112131415161718192021222324252627
  1. $#include "NetworkPriority.h"
  2. /// %Network interest management settings component.
  3. class NetworkPriority : public Component
  4. {
  5. public:
  6. /// Set base priority. Default 100 (send updates at full frequency.)
  7. void SetBasePriority(float priority);
  8. /// Set priority reduction distance factor. Default 0 (no effect.)
  9. void SetDistanceFactor(float factor);
  10. /// Set minimum priority. Default 0 (no updates when far away enough.)
  11. void SetMinPriority(float priority);
  12. /// Set whether updates to owner should be sent always at full rate. Default true.
  13. void SetAlwaysUpdateOwner(bool enable);
  14. /// Return base priority.
  15. float GetBasePriority() const { return basePriority_; }
  16. /// Return priority reduction distance factor.
  17. float GetDistanceFactor() const { return distanceFactor_; }
  18. /// Return minimum priority.
  19. float GetMinPriority() const { return minPriority_; }
  20. /// Return whether updates to owner should be sent always at full rate.
  21. bool GetAlwaysUpdateOwner() const { return alwaysUpdateOwner_; }
  22. /// Increment and check priority accumulator. Return true if should update. Called by Connection.
  23. bool CheckUpdate(float distance, float& accumulator);
  24. };