41 lines
999 B
C++
41 lines
999 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <unordered_map>
|
|
|
|
#include <tinyxml2.h>
|
|
|
|
#include "constants.h"
|
|
|
|
namespace cursebreaker {
|
|
|
|
struct AchievementRequirement
|
|
{
|
|
ActionType action{};
|
|
uint16_t targetId{}; // e.g., item id, npc id, etc.
|
|
uint16_t count{};
|
|
std::string description;
|
|
};
|
|
|
|
struct Achievement
|
|
{
|
|
uint16_t id{};
|
|
uint16_t points{};
|
|
uint16_t category{};
|
|
|
|
std::string name;
|
|
std::string description;
|
|
std::string icon;
|
|
|
|
std::vector<AchievementRequirement> requirements;
|
|
|
|
Achievement() = default;
|
|
};
|
|
|
|
// Achievements configuration functions
|
|
bool loadAchievementsFromXML(const std::string& filepath, std::unordered_map<uint16_t, Achievement>& achievements);
|
|
const Achievement* getAchievementById(uint16_t id, const std::unordered_map<uint16_t, Achievement>& achievements);
|
|
const std::unordered_map<uint16_t, Achievement>& getAllAchievements(const std::unordered_map<uint16_t, Achievement>& achievements);
|
|
|
|
} // namespace cursebreaker
|