2010-08-03 16:20:15 +00:00
|
|
|
#ifndef GAME_MWWORLD_ACTION_H
|
|
|
|
#define GAME_MWWORLD_ACTION_H
|
|
|
|
|
2012-07-27 10:19:25 +00:00
|
|
|
#include <string>
|
|
|
|
|
2012-09-04 13:14:33 +00:00
|
|
|
#include "ptr.hpp"
|
|
|
|
|
2010-08-03 16:20:15 +00:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
/// \brief Abstract base for actions
|
|
|
|
class Action
|
|
|
|
{
|
2012-07-27 10:19:25 +00:00
|
|
|
std::string mSoundId;
|
2012-09-04 18:56:28 +00:00
|
|
|
bool mKeepSound;
|
2013-07-26 16:43:06 +00:00
|
|
|
float mSoundOffset;
|
2012-09-04 13:14:33 +00:00
|
|
|
Ptr mTarget;
|
2012-07-27 10:19:25 +00:00
|
|
|
|
2010-08-03 16:20:15 +00:00
|
|
|
// not implemented
|
|
|
|
Action (const Action& action);
|
|
|
|
Action& operator= (const Action& action);
|
|
|
|
|
2012-07-27 10:00:10 +00:00
|
|
|
virtual void executeImp (const Ptr& actor) = 0;
|
|
|
|
|
2012-09-04 13:14:33 +00:00
|
|
|
protected:
|
|
|
|
|
|
|
|
const Ptr& getTarget() const;
|
|
|
|
|
|
|
|
public:
|
2010-08-03 16:20:15 +00:00
|
|
|
|
2012-09-04 18:56:28 +00:00
|
|
|
Action (bool keepSound = false, const Ptr& target = Ptr());
|
|
|
|
///< \param keepSound Keep playing the sound even if the object the sound is played on is removed.
|
2010-08-03 16:20:15 +00:00
|
|
|
|
2012-07-27 10:00:10 +00:00
|
|
|
virtual ~Action();
|
2010-08-03 16:20:15 +00:00
|
|
|
|
2012-07-27 10:00:10 +00:00
|
|
|
void execute (const Ptr& actor);
|
2012-07-27 10:19:25 +00:00
|
|
|
|
2012-08-26 14:47:45 +00:00
|
|
|
void setSound (const std::string& id);
|
2013-07-26 16:43:06 +00:00
|
|
|
void setSoundOffset(float offset);
|
2010-08-03 16:20:15 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|