forked from mirror/openmw-tes3mp
partially store creature state in saved game files (only attributes and dynamics for now)
parent
b0532e0c85
commit
9788bbcab9
@ -0,0 +1,20 @@
|
||||
|
||||
#include "creaturestats.hpp"
|
||||
|
||||
void ESM::CreatureStats::load (ESMReader &esm)
|
||||
{
|
||||
for (int i=0; i<8; ++i)
|
||||
mAttributes[i].load (esm);
|
||||
|
||||
for (int i=0; i<3; ++i)
|
||||
mDynamic[i].load (esm);
|
||||
}
|
||||
|
||||
void ESM::CreatureStats::save (ESMWriter &esm) const
|
||||
{
|
||||
for (int i=0; i<8; ++i)
|
||||
mAttributes[i].save (esm);
|
||||
|
||||
for (int i=0; i<3; ++i)
|
||||
mDynamic[i].save (esm);
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
#ifndef OPENMW_ESM_CREATURESTATS_H
|
||||
#define OPENMW_ESM_CREATURESTATS_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "statstate.hpp"
|
||||
|
||||
namespace ESM
|
||||
{
|
||||
class ESMReader;
|
||||
class ESMWriter;
|
||||
|
||||
// format 0, saved games only
|
||||
|
||||
struct CreatureStats
|
||||
{
|
||||
StatState<int> mAttributes[8];
|
||||
StatState<float> mDynamic[3];
|
||||
|
||||
void load (ESMReader &esm);
|
||||
void save (ESMWriter &esm) const;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue