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