osb/source/game/StarStatusEffectDatabase.hpp

42 lines
902 B
C++
Raw Permalink Normal View History

#pragma once
2023-06-20 04:33:09 +00:00
#include "StarThread.hpp"
#include "StarStatusTypes.hpp"
namespace Star {
STAR_EXCEPTION(StatusEffectDatabaseException, StarException);
STAR_CLASS(StatusEffectDatabase);
// Named, unique, unstackable scripted effects.
struct UniqueStatusEffectConfig {
String name;
Maybe<String> blockingStat;
Json effectConfig;
float defaultDuration;
StringList scripts;
unsigned scriptDelta;
Maybe<String> animationConfig;
String label;
String description;
Maybe<String> icon;
};
class StatusEffectDatabase {
public:
StatusEffectDatabase();
bool isUniqueEffect(UniqueStatusEffect const& effect) const;
UniqueStatusEffectConfig uniqueEffectConfig(UniqueStatusEffect const& effect) const;
private:
UniqueStatusEffectConfig parseUniqueEffect(Json const& config, String const& path) const;
HashMap<UniqueStatusEffect, UniqueStatusEffectConfig> m_uniqueEffects;
};
}