#ifndef COMPONENTS_ESM_MAGICEFFECTS_H #define COMPONENTS_ESM_MAGICEFFECTS_H #include #include #include #include namespace ESM { class ESMReader; class ESMWriter; // format 0, saved games only struct MagicEffects { // std::map> mEffects; void load(ESMReader& esm); void save(ESMWriter& esm) const; }; struct SummonKey { SummonKey(int32_t effectId, const ESM::RefId& sourceId, int32_t index) : mEffectId(effectId) , mSourceId(sourceId) , mEffectIndex(index) { } int32_t mEffectId; ESM::RefId mSourceId; int32_t mEffectIndex; }; inline auto makeTupleRef(const SummonKey& value) noexcept { return std::tie(value.mEffectId, value.mSourceId, value.mEffectIndex); } inline bool operator==(const SummonKey& l, const SummonKey& r) noexcept { return makeTupleRef(l) == makeTupleRef(r); } inline bool operator<(const SummonKey& l, const SummonKey& r) noexcept { return makeTupleRef(l) < makeTupleRef(r); } } #endif