OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
aisequence.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_COMPONENTS_ESM_AISEQUENCE_H
2 #define OPENMW_COMPONENTS_ESM_AISEQUENCE_H
3 
4 #include <vector>
5 #include <string>
6 
7 #include "defs.hpp"
8 
9 #include "util.hpp"
10 
11 namespace ESM
12 {
13  class ESMReader;
14  class ESMWriter;
15 
16  namespace AiSequence
17  {
18 
19  // format 0, saved games only
20  // As opposed to AiPackageList, this stores the "live" version of AI packages.
21 
23  {
31  };
32 
33 
34  struct AiPackage
35  {
36  virtual ~AiPackage() {}
37  };
38 
39 
40 #pragma pack(push,1)
41  struct AiWanderData
42  {
43  short mDistance;
44  short mDuration;
45  unsigned char mTimeOfDay;
46  unsigned char mIdle[8];
47  unsigned char mShouldRepeat;
48  };
50  {
52  int unused;
53  };
54  struct AiTravelData
55  {
56  float mX, mY, mZ;
57  };
58  struct AiEscortData
59  {
60  float mX, mY, mZ;
61  short mDuration;
62  };
63 
64 #pragma pack(pop)
65 
67  {
69  AiWanderDuration mDurationData; // was ESM::TimeStamp mStartTime
70 
73 
75 
76  void load(ESMReader &esm);
77  void save(ESMWriter &esm) const;
78  };
79 
81  {
83 
84  void load(ESMReader &esm);
85  void save(ESMWriter &esm) const;
86  };
87 
89  {
91 
92  std::string mTargetId;
93  std::string mCellId;
95 
96  void load(ESMReader &esm);
97  void save(ESMWriter &esm) const;
98  };
99 
101  {
103 
104  std::string mTargetId;
105  std::string mCellId;
107 
110 
111  bool mActive;
112 
113  void load(ESMReader &esm);
114  void save(ESMWriter &esm) const;
115  };
116 
118  {
119  std::string mTargetId;
120 
121  void load(ESMReader &esm);
122  void save(ESMWriter &esm) const;
123  };
124 
126  {
128 
129  void load(ESMReader &esm);
130  void save(ESMWriter &esm) const;
131  };
132 
134  {
136 
137  void load(ESMReader &esm);
138  void save(ESMWriter &esm) const;
139  };
140 
142  {
143  int mType;
144 
146  };
147 
148  struct AiSequence
149  {
151  ~AiSequence();
152 
153  std::vector<AiPackageContainer> mPackages;
154 
155  void load (ESMReader &esm);
156  void save (ESMWriter &esm) const;
157 
158  private:
159  AiSequence(const AiSequence&);
161  };
162 
163  }
164 
165 }
166 
167 #endif
void save(ESMWriter &esm) const
Definition: aisequence.cpp:103
Definition: aisequence.hpp:58
bool mCommanded
Definition: aisequence.hpp:109
void load(ESMReader &esm)
Definition: aisequence.cpp:35
void save(ESMWriter &esm) const
Definition: aisequence.cpp:27
AiWanderData mData
Definition: aisequence.hpp:68
unsigned char mShouldRepeat
Definition: aisequence.hpp:47
Definition: esmreader.hpp:21
float mRemainingDuration
Definition: aisequence.hpp:94
float mRemainingDuration
Definition: aisequence.hpp:51
void load(ESMReader &esm)
Definition: aisequence.cpp:15
void load(ESMReader &esm)
Definition: aisequence.cpp:108
AiEscortData mData
Definition: aisequence.hpp:90
void save(ESMWriter &esm) const
Definition: aisequence.cpp:93
Definition: aisequence.hpp:117
Definition: aisequence.hpp:80
void save(ESMWriter &esm) const
Definition: aisequence.cpp:40
float mX
Definition: aisequence.hpp:60
Definition: aisequence.hpp:54
float mY
Definition: aisequence.hpp:60
Definition: aisequence.hpp:25
AiPackage * mPackage
Definition: aisequence.hpp:145
void save(ESMWriter &esm) const
Definition: aisequence.cpp:113
Definition: aisequence.hpp:49
int unused
Definition: aisequence.hpp:52
Definition: aisequence.hpp:24
~AiSequence()
Definition: aisequence.cpp:118
float mY
Definition: aisequence.hpp:56
Definition: aisequence.hpp:26
AiSequence & operator=(const AiSequence &)
Definition: aisequence.hpp:100
Definition: esmwriter.hpp:17
void save(ESMWriter &esm) const
Definition: aisequence.cpp:75
float mX
Definition: aisequence.hpp:56
Definition: aisequence.hpp:66
AiWanderDuration mDurationData
Definition: aisequence.hpp:69
void save(ESMWriter &esm) const
Definition: aisequence.cpp:124
void load(ESMReader &esm)
Definition: aisequence.cpp:62
float mZ
Definition: aisequence.hpp:60
AiEscortData mData
Definition: aisequence.hpp:102
bool mAlwaysFollow
Definition: aisequence.hpp:108
int mTargetActorId
Definition: aisequence.hpp:135
int mType
Definition: aisequence.hpp:143
Definition: util.hpp:32
void load(ESMReader &esm)
Definition: aisequence.cpp:88
std::vector< AiPackageContainer > mPackages
Definition: aisequence.hpp:153
Definition: aisequence.hpp:141
Definition: aisequence.hpp:30
float mRemainingDuration
Definition: aisequence.hpp:106
unsigned char mTimeOfDay
Definition: aisequence.hpp:45
bool mStoredInitialActorPosition
Definition: aisequence.hpp:71
short mDuration
Definition: aisequence.hpp:44
AiPackages
Definition: aisequence.hpp:22
void load(ESMReader &esm)
Definition: aisequence.cpp:45
Definition: aisequence.hpp:28
virtual ~AiPackage()
Definition: aisequence.hpp:36
std::string mCellId
Definition: aisequence.hpp:93
short mDistance
Definition: aisequence.hpp:43
short mDuration
Definition: aisequence.hpp:61
Definition: aisequence.hpp:148
float mZ
Definition: aisequence.hpp:56
Definition: aisequence.hpp:29
std::string mTargetId
Definition: aisequence.hpp:92
Definition: aisequence.hpp:133
Definition: aisequence.hpp:88
bool mActive
Definition: aisequence.hpp:111
Definition: defs.hpp:53
void load(ESMReader &esm)
Definition: aisequence.cpp:159
int mTargetActorId
Definition: aisequence.hpp:127
ESM::Vector3 mInitialActorPosition
Definition: aisequence.hpp:72
Definition: aisequence.hpp:41
void load(ESMReader &esm)
Definition: aisequence.cpp:98
AiTravelData mData
Definition: aisequence.hpp:82
void save(ESMWriter &esm) const
Definition: aisequence.cpp:53
std::string mTargetId
Definition: aisequence.hpp:104
Definition: aisequence.hpp:125
AiSequence()
Definition: aisequence.hpp:150
unsigned char mIdle[8]
Definition: aisequence.hpp:46
Definition: aisequence.hpp:34
std::string mCellId
Definition: aisequence.hpp:105
Definition: aisequence.hpp:27
std::string mTargetId
Definition: aisequence.hpp:119