1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 22:19:54 +00:00
openmw-tes3mp/apps/openmw/mwmechanics/aitravel.hpp

70 lines
1.9 KiB
C++
Raw Normal View History

2012-11-15 21:15:20 +00:00
#ifndef GAME_MWMECHANICS_AITRAVEL_H
#define GAME_MWMECHANICS_AITRAVEL_H
2013-03-26 17:01:01 +00:00
#include "typedaipackage.hpp"
2014-06-12 21:27:04 +00:00
namespace ESM
{
namespace AiSequence
{
struct AiTravel;
}
}
2013-03-26 17:01:01 +00:00
namespace MWMechanics
2014-06-12 21:27:04 +00:00
{
struct AiInternalTravel;
/// \brief Causes the AI to travel to the specified point
class AiTravel : public TypedAiPackage<AiTravel>
2013-03-26 17:01:01 +00:00
{
2014-06-12 21:27:04 +00:00
public:
AiTravel(float x, float y, float z, AiTravel* derived);
AiTravel(float x, float y, float z, AiInternalTravel* derived);
AiTravel(float x, float y, float z);
2014-06-12 21:27:04 +00:00
AiTravel(const ESM::AiSequence::AiTravel* travel);
/// Simulates the passing of time
void fastForward(const MWWorld::Ptr& actor, AiState& state) final;
void writeState(ESM::AiSequence::AiSequence &sequence) const final;
2014-06-12 21:27:04 +00:00
bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) final;
2013-03-26 17:01:01 +00:00
static constexpr TypeId getTypeId() { return TypeIdTravel; }
static constexpr Options makeDefaultOptions()
{
AiPackage::Options options;
options.mUseVariableSpeed = true;
options.mAlwaysActive = true;
return options;
}
osg::Vec3f getDestination() const final { return osg::Vec3f(mX, mY, mZ); }
2013-03-26 17:01:01 +00:00
private:
const float mX;
const float mY;
const float mZ;
2017-12-01 15:58:42 +00:00
const bool mHidden;
2013-03-26 17:01:01 +00:00
};
struct AiInternalTravel final : public AiTravel
{
AiInternalTravel(float x, float y, float z);
explicit AiInternalTravel(const ESM::AiSequence::AiTravel* travel);
static constexpr TypeId getTypeId() { return TypeIdInternalTravel; }
std::unique_ptr<AiPackage> clone() const final;
};
2012-11-14 17:42:04 +00:00
}
2012-11-15 21:15:20 +00:00
#endif