OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
action.hpp
Go to the documentation of this file.
1 #ifndef GAME_MWWORLD_ACTION_H
2 #define GAME_MWWORLD_ACTION_H
3 
4 #include <string>
5 
6 #include "ptr.hpp"
7 
8 namespace MWWorld
9 {
11  class Action
12  {
13  std::string mSoundId;
14  bool mKeepSound;
15  float mSoundOffset;
17 
18  // not implemented
19  Action (const Action& action);
20  Action& operator= (const Action& action);
21 
22  virtual void executeImp (const Ptr& actor) = 0;
23 
24  protected:
25 
26  void setTarget(const Ptr&);
27 
28  public:
29 
30  const Ptr& getTarget() const;
31 
32  Action (bool keepSound = false, const Ptr& target = Ptr());
34 
35  virtual ~Action();
36 
37  virtual bool isNullAction() { return false; }
39 
40  void execute (const Ptr& actor);
41 
42  void setSound (const std::string& id);
43  void setSoundOffset(float offset);
44  };
45 }
46 
47 #endif
void setSound(const std::string &id)
Definition: action.cpp:53
Ptr mTarget
Definition: action.hpp:16
Action(const Action &action)
Abstract base for actions.
Definition: action.hpp:11
void setTarget(const Ptr &)
Definition: action.cpp:15
void setSoundOffset(float offset)
Definition: action.cpp:58
std::string mSoundId
Definition: action.hpp:13
const Ptr & getTarget() const
Definition: action.cpp:10
virtual void executeImp(const Ptr &actor)=0
Action & operator=(const Action &action)
virtual bool isNullAction()
Is running this action a no-op? (default false)
Definition: action.hpp:37
bool mKeepSound
Definition: action.hpp:14
virtual ~Action()
Definition: action.cpp:23
float mSoundOffset
Definition: action.hpp:15
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
void execute(const Ptr &actor)
Definition: action.cpp:25