1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 06:39:49 +00:00
OpenMW/apps/openmw/mwmechanics/aiavoiddoor.hpp

38 lines
1.0 KiB
C++
Raw Normal View History

2014-05-13 17:07:27 +00:00
#ifndef GAME_MWMECHANICS_AIAVOIDDOOR_H
#define GAME_MWMECHANICS_AIAVOIDDOOR_H
#include "aipackage.hpp"
#include <string>
#include "pathfinding.hpp"
#include <components/esm/defs.hpp>
2014-05-13 17:07:27 +00:00
#include "../mwworld/class.hpp"
namespace MWMechanics
{
/// \brief AiPackage to have an actor avoid an opening door
/** The AI will retreat from the door until it has finished opening, walked far away from it, or one second has passed, in an attempt to avoid it
**/
class AiAvoidDoor : public AiPackage
{
2014-05-13 17:07:27 +00:00
public:
/// Avoid door until the door is fully open
AiAvoidDoor(const MWWorld::Ptr& doorPtr);
virtual AiAvoidDoor *clone() const;
virtual bool execute (const MWWorld::Ptr& actor, AiState& state, float duration);
2014-05-13 17:07:27 +00:00
virtual int getTypeId() const;
2014-06-12 21:27:04 +00:00
virtual unsigned int getPriority() const;
2014-05-13 17:07:27 +00:00
private:
float mDuration;
MWWorld::Ptr mDoorPtr;
2014-05-14 17:38:10 +00:00
ESM::Position mLastPos;
float mAdjAngle;
};
}
#endif
2014-05-13 17:07:27 +00:00