4#include <sigc++/trackable.h>
5#include <sigc++/signal.h>
16typedef std::map<std::string, Element> MapType;
20namespace WFMath {
class TimeDiff; }
28class Task :
public sigc::trackable {
41 const std::string&
name()
const;
61 const std::vector<TaskUsage>& getUsages()
const;
63 sigc::signal<void> Completed;
65 sigc::signal<void> Progressed;
67 sigc::signal<void> ProgressRateChanged;
69 sigc::signal<void> UsagesChanged;
72 void progressChanged();
77 void updateFromAtlas(
const Atlas::Message::MapType& d);
82 void updatePredictedProgress(
const WFMath::TimeDiff& dt);
84 const std::string m_name;
89 double m_progressRate;
91 std::vector<TaskUsage> m_usages;
103 return m_progressRate;
107inline const std::vector<TaskUsage>& Task::getUsages()
const {
Entity is a concrete (instantiable) class representing one game entity.
double progress() const
Return the current progress of the task. Value will always be in the range [0..1].
const std::string & name() const
Gets the name of the task.
Task(Entity &owner, std::string name)
double progressRate() const
Gets the progress rate.
bool isComplete() const
Returns true if the task has completed.