mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-24 06:27:24 +00:00
9655f0ee45
fix compile issues
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
#include "eMissionTaskType.h"
|
|
|
|
#ifndef ACHIEVEMENTCACHEKEY_H
|
|
#define ACHIEVEMENTCACHEKEY_H
|
|
|
|
class AchievementCacheKey {
|
|
public:
|
|
AchievementCacheKey() {
|
|
targets = "";
|
|
value = 0;
|
|
type = eMissionTaskType::UNKNOWN;
|
|
};
|
|
|
|
bool operator==(const AchievementCacheKey& point) const {
|
|
return this->targets == point.targets && this->value == point.value && this->type == point.type;
|
|
};
|
|
void SetTargets(const std::string value) { this->targets = value; };
|
|
void SetValue(uint32_t value) { this->value = value; };
|
|
void SetType(eMissionTaskType value) { this->type = value; };
|
|
|
|
std::string GetTargets() const { return this->targets; };
|
|
uint32_t GetValue() const { return this->value; };
|
|
eMissionTaskType GetType() const { return this->type; };
|
|
private:
|
|
std::string targets;
|
|
uint32_t value;
|
|
eMissionTaskType type;
|
|
|
|
};
|
|
|
|
// Specialization of hash for the above class
|
|
namespace std {
|
|
template<>
|
|
struct hash<AchievementCacheKey> {
|
|
size_t operator()(const AchievementCacheKey& key) const {
|
|
size_t hash = 0;
|
|
GeneralUtils::hash_combine(hash, key.GetType());
|
|
GeneralUtils::hash_combine(hash, key.GetValue());
|
|
GeneralUtils::hash_combine(hash, key.GetTargets());
|
|
return hash;
|
|
};
|
|
};
|
|
};
|
|
|
|
#endif //!ACHIEVEMENTCACHEKEY_H
|