SuperTuxKart
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
AchievementInfo Class Reference

This class stores an achievement definition from the xml file, including title, description, but also how to achieve this achievement. More...

#include <achievement_info.hpp>

Classes

struct  goalTree
 

Public Types

enum  operationType { OP_NONE = 0 , OP_ADD = 1 , OP_SUBSTRACT = 2 }
 

Public Member Functions

 AchievementInfo (const XMLNode *input)
 The constructor reads the dat from the xml information.
 
virtual irr::core::stringw goalString ()
 Returns a string with the number of goals to fullfil to get this achievements.
 
virtual irr::core::stringw progressString ()
 Returns a string with the target of the goal if the achievement has only one goal (a sum counts as one goal).
 
int getProgressTarget ()
 
int getGoalCount ()
 
int getDepth ()
 
uint32_t getID () const
 
irr::core::stringw getDescription () const
 
irr::core::stringw getName () const
 
std::string getRawName () const
 
std::string getRawDescription () const
 
bool isSecret () const
 
void copyGoalTree (goalTree &copy, goalTree &model, bool set_values_to_zero)
 Copy a goal tree to an EMPTY goal tree by recursion.
 

Protected Attributes

goalTree m_goal_tree
 The tree storing all goals.
 

Private Member Functions

void parseGoals (const XMLNode *input, goalTree &parent)
 Parses recursively the list of goals, to construct the tree of goals.
 
int recursiveGoalCount (goalTree &parent)
 
int recursiveProgressCount (goalTree &parent)
 
int getRecursiveDepth (goalTree &parent)
 Returns the goal tree's depth.
 

Private Attributes

uint32_t m_id
 The id of this Achievement.
 
std::string m_name
 The title of this achievement.
 
std::string m_description
 The description of this achievement.
 
bool m_is_secret
 A secret achievement has its progress not shown.
 

Friends

class Achievement
 
class AchievementProgressDialog
 

Detailed Description

This class stores an achievement definition from the xml file, including title, description, but also how to achieve this achievement.

Contrast with the Achievement class, which is a player-specific instance tracking the progress of the achievement.

Constructor & Destructor Documentation

◆ AchievementInfo()

AchievementInfo::AchievementInfo ( const XMLNode input)

The constructor reads the dat from the xml information.

Parameters
inputXML node for this achievement info.

Member Function Documentation

◆ getRecursiveDepth()

int AchievementInfo::getRecursiveDepth ( goalTree parent)
private

Returns the goal tree's depth.

If an AND/OR/ANT-AT-ONCE contains only one element, it is ignored (this is useful because the root is always AND ; so for e.g. an OR achievement, we prefer to not display it).


The documentation for this class was generated from the following files: