OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
aipursue.hpp
Go to the documentation of this file.
1 #ifndef GAME_MWMECHANICS_AIPURSUE_H
2 #define GAME_MWMECHANICS_AIPURSUE_H
3 
4 #include "aipackage.hpp"
5 
6 #include "../mwbase/world.hpp"
7 
8 #include "pathfinding.hpp"
9 
10 namespace ESM
11 {
12 namespace AiSequence
13 {
14  struct AiPursue;
15 }
16 }
17 
18 namespace MWMechanics
19 {
21 
24  class AiPursue : public AiPackage
25  {
26  public:
28 
29  AiPursue(const MWWorld::Ptr& actor);
30 
31  AiPursue(const ESM::AiSequence::AiPursue* pursue);
32 
33  virtual AiPursue *clone() const;
34  virtual bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration);
35  virtual int getTypeId() const;
36 
37  MWWorld::Ptr getTarget() const;
38 
39  virtual void writeState (ESM::AiSequence::AiSequence& sequence) const;
40 
41  virtual bool canCancel() const { return false; }
42  virtual bool shouldCancelPreviousAi() const { return false; }
43 
44  private:
45 
46  int mTargetActorId; // The actor to pursue
47  };
48 }
49 #endif
virtual void writeState(ESM::AiSequence::AiSequence &sequence) const
Definition: aipursue.cpp:74
Base class for AI packages.
Definition: aipackage.hpp:32
Makes the actor very closely follow the actor.
Definition: aipursue.hpp:24
virtual bool canCancel() const
Can this Ai package be canceled? (default true)
Definition: aipursue.hpp:41
Definition: character.hpp:145
virtual AiPursue * clone() const
Clones the package.
Definition: aipursue.cpp:27
AiPursue(const MWWorld::Ptr &actor)
Constructor.
Definition: aipursue.cpp:17
Definition: aisequence.hpp:148
Definition: aisequence.hpp:133
virtual bool execute(const MWWorld::Ptr &actor, CharacterController &characterController, AiState &state, float duration)
Definition: aipursue.cpp:31
virtual int getTypeId() const
Definition: aipursue.cpp:64
virtual bool shouldCancelPreviousAi() const
Upon adding this Ai package, should the Ai Sequence attempt to cancel previous Ai packages (default t...
Definition: aipursue.hpp:42
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
int mTargetActorId
Definition: aipursue.hpp:46
MWWorld::Ptr getTarget() const
Get the target actor the AI is targeted at (not applicable to all AI packages, default return empty P...
Definition: aipursue.cpp:69