OpenMW
components/esm/loadcont.hpp
Go to the documentation of this file.
00001 #ifndef OPENMW_ESM_CONT_H
00002 #define OPENMW_ESM_CONT_H
00003 
00004 #include <string>
00005 #include <vector>
00006 
00007 #include "esmcommon.hpp"
00008 
00009 namespace ESM
00010 {
00011 
00012 class ESMReader;
00013 class ESMWriter;
00014 
00015 /*
00016  * Container definition
00017  */
00018 
00019 struct ContItem
00020 {
00021     int mCount;
00022     NAME32 mItem;
00023 };
00024 
00025 struct InventoryList
00026 {
00027     std::vector<ContItem> mList;
00028 
00029     void load(ESMReader &esm);
00030     void save(ESMWriter &esm) const;
00031 };
00032 
00033 struct Container
00034 {
00035     static unsigned int sRecordId;
00036 
00037     enum Flags
00038     {
00039         Organic = 1, // Objects cannot be placed in this container
00040         Respawn = 2, // Respawns after 4 months
00041         Unknown = 8
00042     };
00043 
00044     std::string mId, mName, mModel, mScript;
00045 
00046     float mWeight; // Not sure, might be max total weight allowed?
00047     int mFlags;
00048     InventoryList mInventory;
00049 
00050     void load(ESMReader &esm);
00051     void save(ESMWriter &esm) const;
00052 
00053     void blank();
00055 };
00056 }
00057 #endif