19#ifndef HEADER_CHALLENGE_STATUS_HPP
20#define HEADER_CHALLENGE_STATUS_HPP
33#include "race/race_manager.hpp"
34#include "utils/no_copy.hpp"
61 bool m_max_req_in_lower_diff;
72 m_max_req_in_lower_diff =
false;
84 return ((m_solved >> (
int) d)&0x01) == 1;
94 return (m_solved & 0x08) ? RaceManager::DIFFICULTY_BEST :
95 (m_solved & 0x04) ? RaceManager::DIFFICULTY_HARD :
96 (m_solved & 0x02) ? RaceManager::DIFFICULTY_MEDIUM :
97 (m_solved & 0x01) ? RaceManager::DIFFICULTY_EASY :
98 RaceManager::DIFFICULTY_NONE;
105 return ((m_active >> (
int) d)&0x01) == 1;
112 m_active |= (0x01 << (int) d);
127 m_max_req_in_lower_diff =
true;
134 return m_max_req_in_lower_diff;
the description of one challenge
Definition: challenge_data.hpp:35
The state of a challenge for one player.
Definition: challenge_status.hpp:53
bool isSolved(RaceManager::Difficulty d) const
Returns if this challenge was solved at the specified difficulty.
Definition: challenge_status.hpp:82
bool areMaxReqMetInLowerDiff() const
Returns if the hardest difficulty requirements have been met in a lower difficulty.
Definition: challenge_status.hpp:132
void setActive(RaceManager::Difficulty d)
Sets this challenge to be active.
Definition: challenge_status.hpp:110
const ChallengeData * m_data
Pointer to the original challenge data.
Definition: challenge_status.hpp:64
RaceManager::Difficulty highestSolved() const
Returns the highest difficulty at which this challenge was solved.
Definition: challenge_status.hpp:92
bool isUnlockList()
Returns if this challenge is only an unlock list.
Definition: challenge_status.cpp:81
void setMaxReqInLowerDiff()
Used when a challenge's requirement in the hardest difficulty are matched in a lower difficulty.
Definition: challenge_status.hpp:124
bool isActive(RaceManager::Difficulty d) const
True if this challenge is active at the given difficulty.
Definition: challenge_status.hpp:103
void load(const XMLNode *config)
Loads the state for a challenge object (esp.
Definition: challenge_status.cpp:36
bool isGrandPrix()
Returns if this challenge is a grand prix.
Definition: challenge_status.cpp:87
bool isSolvedAtAnyDifficulty() const
Returns true if this challenge was solved at any difficult.
Definition: challenge_status.hpp:89
const ChallengeData * getData() const
Returns a pointer to the actual Challenge data.
Definition: challenge_status.hpp:139
Utility class, you can inherit from this class to disallow the assignment operator and copy construct...
Definition: no_copy.hpp:26
Difficulty
Game difficulty.
Definition: race_manager.hpp:230
utility class used to write wide (UTF-16 or UTF-32, depending of size of wchar_t) XML files
Definition: utf_writer.hpp:35
utility class used to parse XML files
Definition: xml_node.hpp:48