1 #ifndef GAME_MWMECHANICS_STAT_H
2 #define GAME_MWMECHANICS_STAT_H
26 Stat(T base, T modified);
34 void set (
const T& value);
40 void setModified (T value,
const T& min,
const T& max = std::numeric_limits<T>::max());
57 return !(left==right);
79 void set (
const T& value);
85 void setModified (T value,
const T& min,
const T& max = std::numeric_limits<T>::max());
87 void setCurrent (
const T& value,
bool allowDecreaseBelowZero =
false);
88 void setModifier (
const T& modifier,
bool allowCurrentDecreaseBelowZero=
false);
97 return left.getBase()==right.getBase() &&
98 left.getModified()==right.getModified() &&
99 left.getCurrent()==right.getCurrent();
105 return !(left==right);
157 return !(left == right);
169 return !(left == right);
Stat()
Definition: stat.cpp:8
T Type
Definition: stat.hpp:67
float mProgress
Definition: stat.hpp:139
float getDamage() const
Definition: stat.cpp:209
float mDamage
Definition: stat.hpp:112
Stat< T > mStatic
Definition: stat.hpp:63
void setModified(T value, const T &min, const T &max=std::numeric_limits< T >::max())
Set modified value an adjust base accordingly.
Definition: stat.cpp:122
void restore(float amount)
Definition: stat.cpp:204
void setModifier(int mod)
Definition: stat.cpp:195
void set(const T &value)
Set base, modified and current to value.
Definition: stat.cpp:108
bool operator==(const Stat< T > &left, const Stat< T > &right)
Definition: stat.hpp:48
void setProgress(float progress)
Definition: stat.cpp:237
void setBase(int base)
Definition: stat.cpp:190
void setModifier(const T &modifier, bool allowCurrentDecreaseBelowZero=false)
Definition: stat.cpp:152
void writeState(ESM::StatState< int > &state) const
Definition: stat.cpp:242
void readState(const ESM::StatState< T > &state)
Definition: stat.cpp:166
const T & getCurrent() const
Definition: stat.cpp:102
T getModifier() const
Definition: stat.cpp:26
void readState(const ESM::StatState< int > &state)
Definition: stat.cpp:248
T mModified
Definition: stat.hpp:19
int getModified() const
Definition: stat.cpp:177
void writeState(ESM::StatState< T > &state) const
Definition: stat.cpp:160
void writeState(ESM::StatState< T > &state) const
Definition: stat.cpp:68
void readState(const ESM::StatState< T > &state)
Definition: stat.cpp:74
DynamicStat()
Definition: stat.cpp:82
const T & getBase() const
Definition: stat.cpp:92
T mCurrent
Definition: stat.hpp:64
AttributeValue()
Definition: stat.cpp:172
T mBase
Definition: stat.hpp:18
float getProgress() const
Definition: stat.cpp:233
T getModified() const
Definition: stat.cpp:97
int mBase
Definition: stat.hpp:110
int getModifier() const
Definition: stat.cpp:185
Definition: windowmanager.hpp:41
void readState(const ESM::StatState< int > &state)
Definition: stat.cpp:221
T Type
Definition: stat.hpp:22
void setBase(const T &value)
Set base and adjust modified accordingly.
Definition: stat.cpp:36
void setCurrent(const T &value, bool allowDecreaseBelowZero=false)
Definition: stat.cpp:130
int getBase() const
Definition: stat.cpp:181
void writeState(ESM::StatState< int > &state) const
Definition: stat.cpp:214
void set(const T &value)
Set base and modified to value.
Definition: stat.cpp:31
int mModifier
Definition: stat.hpp:111
void damage(float damage)
Definition: stat.cpp:200
void setBase(const T &value)
Set base and adjust modified accordingly.
Definition: stat.cpp:114
void setModified(T value, const T &min, const T &max=std::numeric_limits< T >::max())
Set modified value an adjust base accordingly.
Definition: stat.cpp:43
const T & getBase() const
Definition: stat.cpp:15
void setModifier(const T &modifier)
Definition: stat.cpp:62
SkillValue()
Definition: stat.cpp:228
bool operator!=(const Stat< T > &left, const Stat< T > &right)
Definition: stat.hpp:55
T getModified() const
Definition: stat.cpp:21