SuperTuxKart
Public Member Functions | Private Attributes | List of all members
ChallengeStatus Class Reference

The state of a challenge for one player. More...

#include <challenge_status.hpp>

Inheritance diagram for ChallengeStatus:
Inheritance graph
[legend]

Public Member Functions

 ChallengeStatus (const ChallengeData *data)
 
void load (const XMLNode *config)
 Loads the state for a challenge object (esp. More...
 
void save (UTFWriter &writer)
 
void setSolved (RaceManager::Difficulty d)
 
bool isSolved (RaceManager::Difficulty d) const
 Returns if this challenge was solved at the specified difficulty.
 
bool isSolvedAtAnyDifficulty () const
 Returns true if this challenge was solved at any difficult.
 
RaceManager::Difficulty highestSolved () const
 Returns the highest difficulty at which this challenge was solved.
 
bool isActive (RaceManager::Difficulty d) const
 True if this challenge is active at the given difficulty.
 
void setActive (RaceManager::Difficulty d)
 Sets this challenge to be active.
 
bool isUnlockList ()
 Returns if this challenge is only an unlock list.
 
bool isGrandPrix ()
 Returns if this challenge is a grand prix.
 
void setMaxReqInLowerDiff ()
 Used when a challenge's requirement in the hardest difficulty are matched in a lower difficulty. More...
 
bool areMaxReqMetInLowerDiff () const
 Returns if the hardest difficulty requirements have been met in a lower difficulty. More...
 
const ChallengeDatagetData () const
 Returns a pointer to the actual Challenge data.
 

Private Attributes

int m_active
 
int m_solved
 
bool m_max_req_in_lower_diff
 
const ChallengeDatam_data
 Pointer to the original challenge data. More...
 

Detailed Description

The state of a challenge for one player.

Each ChallengeStatus has one ChallengeData associcated, which stores the actual data about the challenge. The ChallengeStatus stores if the challenge is not possible yet (inactive), active (i.e. user can try to solve it), or solved. This status is stored for each difficulty level. This data is saved to and loaded from the players.xml file. A StoryModeStatus instance will store an array of ChallengeStatuses, one for each Challenge in STK.

Member Function Documentation

◆ areMaxReqMetInLowerDiff()

bool ChallengeStatus::areMaxReqMetInLowerDiff ( ) const
inline

Returns if the hardest difficulty requirements have been met in a lower difficulty.

◆ load()

void ChallengeStatus::load ( const XMLNode challenges_node)

Loads the state for a challenge object (esp.

m_state)

◆ setMaxReqInLowerDiff()

void ChallengeStatus::setMaxReqInLowerDiff ( )
inline

Used when a challenge's requirement in the hardest difficulty are matched in a lower difficulty.

Don't apply to GP

Member Data Documentation

◆ m_data

const ChallengeData* ChallengeStatus::m_data
private

Pointer to the original challenge data.


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