]> git.tdb.fi Git - netvis.git/blobdiff - source/host.h
Move activity tracking to a separate class
[netvis.git] / source / host.h
index b600dea04e3d9d315c865fbaabb3df7d69fc5e5b..ec2741d6b7127183381cb6f858b054b8d0fd5dc2 100644 (file)
@@ -11,6 +11,7 @@ Distributed unter the GPL
 #include <map>
 #include <string>
 #include <msp/time/timedelta.h>
+#include "activity.h"
 #include "vector2.h"
 
 class NetVis;
@@ -25,7 +26,7 @@ private:
        bool local;
        Vector2 pos;
        bool active;
-       float activity;
+       Activity activity;
        float throttle;
 
 public:
@@ -41,7 +42,7 @@ public:
        void set_active(bool);
        bool get_active() const { return active; }
        void add_activity(unsigned);
-       float get_activity() const { return activity; }
+       float get_activity() const { return activity.get_average(); }
        float send_packet();
 
        void tick(const Msp::Time::TimeDelta &);