The Battle for Wesnoth  1.19.5+dev
Public Member Functions | Public Attributes | List of all members
achievement Struct Reference

Represents a single achievement and its data. More...

#include <achievements.hpp>

Public Member Functions

 achievement (const config &cfg, const std::string &content_for, bool achieved, int progress)
 

Public Attributes

std::string id_
 The ID of the achievement. More...
 
t_string name_
 The name of the achievement to show on the UI. More...
 
t_string name_completed_
 The name of the achievement to show on the UI if the achievement is completed. More...
 
t_string description_
 The description of the achievement to show on the UI. More...
 
t_string description_completed_
 The name of the achievement to show on the UI if the achievement is completed. More...
 
std::string icon_
 The icon of the achievement to show on the UI. More...
 
std::string icon_completed_
 The icon of the achievement to show on the UI if the achievement is completed. More...
 
bool hidden_
 Whether to show the achievement's actual name and description on the UI before it's been completed. More...
 
bool achieved_
 Whether the achievement has been completed. More...
 
int max_progress_
 When the achievement's current progress matches or equals this value, then it should be marked as completed. More...
 
int current_progress_
 The current progress value of the achievement. More...
 
std::string sound_path_
 The path to a sound to play when an achievement is completed. More...
 
std::vector< sub_achievementsub_achievements_
 The list of distinct sub-achievements for this achievement. More...
 

Detailed Description

Represents a single achievement and its data.

Definition at line 47 of file achievements.hpp.

Constructor & Destructor Documentation

◆ achievement()

achievement::achievement ( const config cfg,
const std::string &  content_for,
bool  achieved,
int  progress 
)

Member Data Documentation

◆ achieved_

bool achievement::achieved_

◆ current_progress_

int achievement::current_progress_

The current progress value of the achievement.

Definition at line 70 of file achievements.hpp.

Referenced by game_lua_kernel::intf_progress_achievement(), game_lua_kernel::intf_set_achievement(), and game_lua_kernel::intf_set_sub_achievement().

◆ description_

t_string achievement::description_

The description of the achievement to show on the UI.

Definition at line 56 of file achievements.hpp.

Referenced by achievement().

◆ description_completed_

t_string achievement::description_completed_

The name of the achievement to show on the UI if the achievement is completed.

Definition at line 58 of file achievements.hpp.

Referenced by achievement(), and game_lua_kernel::intf_set_achievement().

◆ hidden_

bool achievement::hidden_

Whether to show the achievement's actual name and description on the UI before it's been completed.

Definition at line 64 of file achievements.hpp.

◆ icon_

std::string achievement::icon_

The icon of the achievement to show on the UI.

Definition at line 60 of file achievements.hpp.

◆ icon_completed_

std::string achievement::icon_completed_

The icon of the achievement to show on the UI if the achievement is completed.

Definition at line 62 of file achievements.hpp.

Referenced by achievement(), and game_lua_kernel::intf_set_achievement().

◆ id_

std::string achievement::id_

◆ max_progress_

int achievement::max_progress_

When the achievement's current progress matches or equals this value, then it should be marked as completed.

Definition at line 68 of file achievements.hpp.

Referenced by achievement(), game_lua_kernel::intf_progress_achievement(), game_lua_kernel::intf_set_achievement(), and game_lua_kernel::intf_set_sub_achievement().

◆ name_

t_string achievement::name_

The name of the achievement to show on the UI.

Definition at line 52 of file achievements.hpp.

Referenced by achievement().

◆ name_completed_

t_string achievement::name_completed_

The name of the achievement to show on the UI if the achievement is completed.

Definition at line 54 of file achievements.hpp.

Referenced by achievement(), and game_lua_kernel::intf_set_achievement().

◆ sound_path_

std::string achievement::sound_path_

The path to a sound to play when an achievement is completed.

Definition at line 72 of file achievements.hpp.

Referenced by game_lua_kernel::intf_set_achievement().

◆ sub_achievements_

std::vector<sub_achievement> achievement::sub_achievements_

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