The type used for Stat/DynamicStat templates are now stored as a typedef. Added some convenience constructors for initializing Stat/DynamicStat objects.

This commit is contained in:
Jan Borsodi 2010-09-20 13:10:15 +02:00
parent eec34e9f0e
commit 647129c866

View file

@ -12,8 +12,11 @@ namespace MWMechanics
T mModified; T mModified;
public: public:
typedef T Type;
Stat() : mBase (0), mModified (0) {} Stat() : mBase (0), mModified (0) {}
Stat(T base) : mBase (base), mModified (base) {}
Stat(T base, T modified) : mBase (base), mModified (modified) {}
const T& getBase() const const T& getBase() const
{ {
@ -86,8 +89,12 @@ namespace MWMechanics
T mCurrent; T mCurrent;
public: public:
typedef T Type;
DynamicStat() : mCurrent (0) {} DynamicStat() : mCurrent (0) {}
DynamicStat(T current) : mCurrent (current) {}
DynamicStat(T base, T modified, T current) : mStatic(base, modified), mCurrent (current) {}
DynamicStat(const Stat<T> &stat, T current) : mStatic(stat), mCurrent (current) {}
const T& getBase() const const T& getBase() const
{ {