(svn r25296) -Feature: Goals can now have a progress text and/or be marked as completed.

This commit is contained in:
zuu
2013-05-26 19:54:43 +00:00
parent 05c472f08a
commit a4cddc3e08
15 changed files with 256 additions and 28 deletions

View File

@@ -108,6 +108,50 @@ public:
*/
static bool Remove(GoalID goal_id);
/**
* Update goal text of a goal.
* @param goal_id The goal to update.
* @param goal The new goal text (can be either a raw string, or a ScriptText object).
* @return True if the action succeeded.
* @pre No ScriptCompanyMode may be in scope.
* @pre goal != NULL && len(goal) != 0.
* @pre IsValidGoal(goal_id).
*/
static bool SetText(GoalID goal_id, Text *goal);
/**
* Update the progress text of a goal. The progress text is a text that
* is shown adjacent to the goal but in a separate column. Try to keep
* the progress string short.
* @param goal_id The goal to update.
* @param progress The new progress text for the goal (can be either a raw string,
* or a ScriptText object). To clear the progress string you can pass NULL or an
* empty string.
* @return True if the action succeeded.
* @pre No ScriptCompanyMode may be in scope.
* @pre IsValidGoal(goal_id).
*/
static bool SetProgress(GoalID goal_id, Text *progress);
/**
* Update completed status of goal
* @param goal_id The goal to update.
* @param complete The new goal completed status.
* @return True if the action succeeded.
* @pre No ScriptCompanyMode may be in scope.
* @pre IsValidGoal(goal_id).
*/
static bool SetCompleted(GoalID goal_id, bool complete);
/**
* Checks if a given goal have been marked as completed.
* @param goal_id The goal to check complete status.
* @return True if the goal is completed, otherwise false.
* @pre No ScriptCompanyMode may be in scope.
* @pre IsValidGoal(goal_id).
*/
static bool IsCompleted(GoalID goal_id);
/**
* Ask a question.
* @param uniqueid Your unique id to distinguish results of multiple questions in the returning event.