OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
aiescort.hpp
Go to the documentation of this file.
1 #ifndef GAME_MWMECHANICS_AIESCORT_H
2 #define GAME_MWMECHANICS_AIESCORT_H
3 
4 #include "aipackage.hpp"
5 
6 #include <string>
7 
8 #include "pathfinding.hpp"
9 
10 namespace ESM
11 {
12 namespace AiSequence
13 {
14  struct AiEscort;
15 }
16 }
17 
18 namespace MWMechanics
19 {
21  class AiEscort : public AiPackage
22  {
23  public:
25 
27  AiEscort(const std::string &actorId, int duration, float x, float y, float z);
29 
31  AiEscort(const std::string &actorId, const std::string &cellId, int duration, float x, float y, float z);
32 
33  AiEscort(const ESM::AiSequence::AiEscort* escort);
34 
35  virtual AiEscort *clone() const;
36 
37  virtual bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration);
38 
39  virtual int getTypeId() const;
40 
41  virtual bool sideWithTarget() const { return true; }
42 
43  void writeState(ESM::AiSequence::AiSequence &sequence) const;
44 
45  void fastForward(const MWWorld::Ptr& actor, AiState& state);
46 
47  private:
48  std::string mCellId;
49  float mX;
50  float mY;
51  float mZ;
52  float mMaxDist;
53  float mDuration; // In hours
54  float mRemainingDuration; // In hours
55 
56  int mCellX;
57  int mCellY;
58  };
59 }
60 #endif
virtual bool execute(const MWWorld::Ptr &actor, CharacterController &characterController, AiState &state, float duration)
Definition: aiescort.cpp:65
void writeState(ESM::AiSequence::AiSequence &sequence) const
Definition: aiescort.cpp:126
int mCellY
Definition: aiescort.hpp:57
virtual int getTypeId() const
Definition: aiescort.cpp:121
AiEscort(const std::string &actorId, int duration, float x, float y, float z)
Implementation of AiEscort.
Definition: aiescort.cpp:24
std::string mCellId
Definition: aiescort.hpp:48
virtual bool sideWithTarget() const
Return true if having this AiPackage makes the actor side with the target in fights (default false) ...
Definition: aiescort.hpp:41
float mZ
Definition: aiescort.hpp:51
AI Package to have an NPC lead the player to a specific point.
Definition: aiescort.hpp:21
Base class for AI packages.
Definition: aipackage.hpp:33
float mRemainingDuration
Definition: aiescort.hpp:54
float mDuration
Definition: aiescort.hpp:53
Definition: character.hpp:154
float mX
Definition: aiescort.hpp:49
int mCellX
Definition: aiescort.hpp:56
float mMaxDist
Definition: aiescort.hpp:52
void fastForward(const MWWorld::Ptr &actor, AiState &state)
Simulates the passing of time.
Definition: aiescort.cpp:143
float mY
Definition: aiescort.hpp:50
Definition: aisequence.hpp:151
Definition: aisequence.hpp:89
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
virtual AiEscort * clone() const
Clones the package.
Definition: aiescort.cpp:60