2016-07-09 02:16:47 +02:00
|
|
|
#ifndef GAME_MWMECHANICS_AIFACE_H
|
|
|
|
#define GAME_MWMECHANICS_AIFACE_H
|
|
|
|
|
2020-05-17 22:10:36 +02:00
|
|
|
#include "typedaipackage.hpp"
|
2016-07-09 02:16:47 +02:00
|
|
|
|
|
|
|
namespace MWMechanics
|
|
|
|
{
|
|
|
|
/// AiPackage which makes an actor face a certain direction.
|
2020-05-17 22:10:36 +02:00
|
|
|
class AiFace final : public TypedAiPackage<AiFace> {
|
2016-07-09 02:16:47 +02:00
|
|
|
public:
|
|
|
|
AiFace(float targetX, float targetY);
|
|
|
|
|
2020-10-22 23:57:53 +02:00
|
|
|
bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) override;
|
2016-07-09 02:16:47 +02:00
|
|
|
|
2020-05-16 21:52:16 +02:00
|
|
|
static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Face; }
|
2020-05-16 21:08:39 +02:00
|
|
|
|
|
|
|
static constexpr Options makeDefaultOptions()
|
|
|
|
{
|
|
|
|
AiPackage::Options options;
|
|
|
|
options.mPriority = 2;
|
|
|
|
options.mCanCancel = false;
|
|
|
|
options.mShouldCancelPreviousAi = false;
|
|
|
|
return options;
|
|
|
|
}
|
2016-07-09 02:16:47 +02:00
|
|
|
|
|
|
|
private:
|
2020-06-02 21:30:46 +02:00
|
|
|
const float mTargetX;
|
|
|
|
const float mTargetY;
|
2016-07-09 02:16:47 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|