2012-11-15 22:22:44 +01:00
|
|
|
#ifndef GAME_MWMECHANICS_AIACTIVATE_H
|
|
|
|
#define GAME_MWMECHANICS_AIACTIVATE_H
|
|
|
|
|
2020-05-17 22:10:36 +02:00
|
|
|
#include "typedaipackage.hpp"
|
2016-06-17 23:07:16 +09:00
|
|
|
|
2014-04-01 14:15:55 -04:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "pathfinding.hpp"
|
|
|
|
|
2014-06-12 23:27:04 +02:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
namespace AiSequence
|
|
|
|
{
|
|
|
|
struct AiActivate;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-01 14:15:55 -04:00
|
|
|
namespace MWMechanics
|
2014-06-12 23:27:04 +02:00
|
|
|
{
|
|
|
|
/// \brief Causes actor to walk to activatable object and activate it
|
2014-05-13 20:32:29 -04:00
|
|
|
/** Will activate when close to object **/
|
2020-05-17 22:10:36 +02:00
|
|
|
class AiActivate final : public TypedAiPackage<AiActivate>
|
2012-11-16 18:38:15 +01:00
|
|
|
{
|
2014-06-12 23:27:04 +02:00
|
|
|
public:
|
|
|
|
/// Constructor
|
2014-04-29 23:40:59 -04:00
|
|
|
/** \param objectId Reference to object to activate **/
|
2014-04-02 00:18:22 -04:00
|
|
|
AiActivate(const std::string &objectId);
|
2014-06-12 23:27:04 +02:00
|
|
|
|
|
|
|
AiActivate(const ESM::AiSequence::AiActivate* activate);
|
|
|
|
|
2020-05-16 18:56:02 +02:00
|
|
|
bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) final;
|
2020-05-16 21:08:39 +02:00
|
|
|
|
2020-05-16 21:52:16 +02:00
|
|
|
static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Activate; }
|
2012-11-15 22:22:44 +01:00
|
|
|
|
2020-05-16 18:56:02 +02:00
|
|
|
void writeState(ESM::AiSequence::AiSequence& sequence) const final;
|
2014-06-12 23:27:04 +02:00
|
|
|
|
2014-04-01 14:15:55 -04:00
|
|
|
private:
|
2020-06-02 21:30:46 +02:00
|
|
|
const std::string mObjectId;
|
2012-11-16 18:38:15 +01:00
|
|
|
};
|
2012-11-15 22:22:44 +01:00
|
|
|
}
|
|
|
|
#endif // GAME_MWMECHANICS_AIACTIVATE_H
|