2014-08-17 02:58:58 +00:00
|
|
|
#ifndef COMPONENTS_ESM_MAGICEFFECTS_H
|
|
|
|
#define COMPONENTS_ESM_MAGICEFFECTS_H
|
|
|
|
|
|
|
|
#include <map>
|
2020-08-28 18:43:22 +00:00
|
|
|
#include <string>
|
2014-08-17 02:58:58 +00:00
|
|
|
|
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
class ESMReader;
|
|
|
|
class ESMWriter;
|
|
|
|
|
|
|
|
// format 0, saved games only
|
|
|
|
struct MagicEffects
|
|
|
|
{
|
|
|
|
// <Effect Id, Base value>
|
|
|
|
std::map<int, int> mEffects;
|
|
|
|
|
|
|
|
void load (ESMReader &esm);
|
|
|
|
void save (ESMWriter &esm) const;
|
|
|
|
};
|
|
|
|
|
2020-08-28 18:43:22 +00:00
|
|
|
struct SummonKey
|
|
|
|
{
|
|
|
|
SummonKey(int effectId, const std::string& sourceId, int index)
|
|
|
|
{
|
|
|
|
mEffectId = effectId;
|
|
|
|
mSourceId = sourceId;
|
|
|
|
mEffectIndex = index;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator==(const SummonKey &other) const
|
|
|
|
{
|
|
|
|
return mEffectId == other.mEffectId &&
|
|
|
|
mSourceId == other.mSourceId &&
|
|
|
|
mEffectIndex == other.mEffectIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator<(const SummonKey &other) const
|
|
|
|
{
|
|
|
|
if (mEffectId < other.mEffectId)
|
|
|
|
return true;
|
2020-09-04 09:45:38 +00:00
|
|
|
if (mEffectId > other.mEffectId)
|
|
|
|
return false;
|
2020-08-28 18:43:22 +00:00
|
|
|
|
|
|
|
if (mSourceId < other.mSourceId)
|
|
|
|
return true;
|
2020-09-04 09:45:38 +00:00
|
|
|
if (mSourceId > other.mSourceId)
|
|
|
|
return false;
|
2020-08-28 18:43:22 +00:00
|
|
|
|
|
|
|
return mEffectIndex < other.mEffectIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
int mEffectId;
|
|
|
|
std::string mSourceId;
|
|
|
|
int mEffectIndex;
|
|
|
|
};
|
2014-08-17 02:58:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|