OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadcont.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_ESM_CONT_H
2 #define OPENMW_ESM_CONT_H
3 
4 #include <string>
5 #include <vector>
6 
7 #include "esmcommon.hpp"
8 
9 namespace ESM
10 {
11 
12 class ESMReader;
13 class ESMWriter;
14 
15 /*
16  * Container definition
17  */
18 
19 struct ContItem
20 {
21  int mCount;
23 };
24 
27 {
28  std::vector<ContItem> mList;
29 
31  void add(ESMReader &esm);
32 
33  void save(ESMWriter &esm) const;
34 };
35 
36 struct Container
37 {
38  static unsigned int sRecordId;
40  static std::string getRecordType() { return "Container"; }
41 
42  enum Flags
43  {
44  Organic = 1, // Objects cannot be placed in this container
45  Respawn = 2, // Respawns after 4 months
46  Unknown = 8
47  };
48 
49  std::string mId, mName, mModel, mScript;
50 
51  float mWeight; // Not sure, might be max total weight allowed?
52  int mFlags;
54 
55  void load(ESMReader &esm, bool &isDeleted);
56  void save(ESMWriter &esm, bool isDeleted = false) const;
57 
58  void blank();
60 };
61 }
62 #endif
void blank()
Set record to default state (does not touch the ID).
Definition: loadcont.cpp:107
static unsigned int sRecordId
Definition: loadcont.hpp:38
std::string mScript
Definition: loadcont.hpp:49
Definition: loadcont.hpp:19
Definition: esmreader.hpp:21
int mCount
Definition: loadcont.hpp:21
NAME32 mItem
Definition: loadcont.hpp:22
InventoryList, NPCO subrecord.
Definition: loadcont.hpp:26
std::string mId
Definition: loadcont.hpp:49
int mFlags
Definition: loadcont.hpp:52
Definition: esmwriter.hpp:17
std::string mModel
Definition: loadcont.hpp:49
std::vector< ContItem > mList
Definition: loadcont.hpp:28
float mWeight
Definition: loadcont.hpp:51
InventoryList mInventory
Definition: loadcont.hpp:53
void add(ESMReader &esm)
Load one item, assumes subrecord name is already read.
Definition: loadcont.cpp:10
std::string mName
Definition: loadcont.hpp:49
void load(ESMReader &esm, bool &isDeleted)
Definition: loadcont.cpp:27
Flags
Definition: loadcont.hpp:42
void save(ESMWriter &esm, bool isDeleted=false) const
Definition: loadcont.cpp:87
Definition: loadcont.hpp:44
void save(ESMWriter &esm) const
Definition: loadcont.cpp:17
Definition: loadcont.hpp:46
static std::string getRecordType()
Return a string descriptor for this record type. Currently used for debugging / error logs only...
Definition: loadcont.hpp:40
Definition: loadcont.hpp:36
Definition: loadcont.hpp:45