OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadscpt.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_ESM_SCPT_H
2 #define OPENMW_ESM_SCPT_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  * Script definitions
17  */
18 
19 class Script
20 {
21 public:
22  static unsigned int sRecordId;
24  static std::string getRecordType() { return "Script"; }
25 
26  struct SCHDstruct
27  {
31  };
32  struct SCHD
33  {
36  }; // 52 bytes
37 
38  std::string mId;
39 
41 
44  std::vector<std::string> mVarNames;
45 
48  std::vector<unsigned char> mScriptData;
49 
51  std::string mScriptText;
52 
53  void load(ESMReader &esm, bool &isDeleted);
54  void save(ESMWriter &esm, bool isDeleted = false) const;
55 
56  void blank();
58 
59 private:
60  void loadSCVR(ESMReader &esm);
61 };
62 }
63 #endif
SCHDstruct mData
Definition: loadscpt.hpp:40
NAME32 mName
Definition: loadscpt.hpp:34
int mNumFloats
Definition: loadscpt.hpp:30
int mNumLongs
Definition: loadscpt.hpp:30
Definition: loadscpt.hpp:32
Script::SCHDstruct mData
Definition: loadscpt.hpp:35
Definition: esmreader.hpp:21
void save(ESMWriter &esm, bool isDeleted=false) const
Definition: loadscpt.cpp:107
void loadSCVR(ESMReader &esm)
Definition: loadscpt.cpp:13
Definition: loadscpt.hpp:19
std::vector< unsigned char > mScriptData
Definition: loadscpt.hpp:48
int mScriptDataSize
Definition: loadscpt.hpp:30
static unsigned int sRecordId
Definition: loadscpt.hpp:22
Definition: esmwriter.hpp:17
std::vector< std::string > mVarNames
Definition: loadscpt.hpp:44
static std::string getRecordType()
Return a string descriptor for this record type. Currently used for debugging / error logs only...
Definition: loadscpt.hpp:24
std::string mId
Definition: loadscpt.hpp:38
int mNumShorts
Definition: loadscpt.hpp:30
void load(ESMReader &esm, bool &isDeleted)
Definition: loadscpt.cpp:60
void blank()
Set record to default state (does not touch the ID/index).
Definition: loadscpt.cpp:145
int mStringTableSize
Definition: loadscpt.hpp:30
Definition: loadscpt.hpp:26
std::string mScriptText
Script source code.
Definition: loadscpt.hpp:51