OpenMW
components/esm/loadrace.hpp
Go to the documentation of this file.
00001 #ifndef OPENMW_ESM_RACE_H
00002 #define OPENMW_ESM_RACE_H
00003 
00004 #include <string>
00005 
00006 #include "spelllist.hpp"
00007 
00008 namespace ESM
00009 {
00010 
00011 class ESMReader;
00012 class ESMWriter;
00013 
00014 /*
00015  * Race definition
00016  */
00017 
00018 struct Race
00019 {
00020     static unsigned int sRecordId;
00021 
00022     struct SkillBonus
00023     {
00024         int mSkill; // SkillEnum
00025         int mBonus;
00026     };
00027 
00028     struct MaleFemale
00029     {
00030         int mMale, mFemale;
00031 
00032         int getValue (bool male) const;
00033     };
00034 
00035     struct MaleFemaleF
00036     {
00037         float mMale, mFemale;
00038 
00039         int getValue (bool male) const;
00040     };
00041 
00042     enum Flags
00043     {
00044         Playable = 0x01,
00045         Beast = 0x02
00046     };
00047 
00048     struct RADTstruct
00049     {
00050         // List of skills that get a bonus
00051         SkillBonus mBonus[7];
00052 
00053         // Attribute values for male/female
00054         MaleFemale mAttributeValues[8];
00055 
00056         // The actual eye level height (in game units) is (probably) given
00057         // as 'height' times 128. This has not been tested yet.
00058         MaleFemaleF mHeight, mWeight;
00059 
00060         int mFlags; // 0x1 - playable, 0x2 - beast race
00061 
00062     }; // Size = 140 bytes
00063 
00064     RADTstruct mData;
00065 
00066     std::string mId, mName, mDescription;
00067     SpellList mPowers;
00068 
00069     void load(ESMReader &esm);
00070     void save(ESMWriter &esm) const;
00071 
00072     void blank();
00074 };
00075 
00076 }
00077 #endif