2012-11-15 22:15:20 +01:00
|
|
|
#ifndef GAME_MWMECHANICS_AITRAVEL_H
|
|
|
|
#define GAME_MWMECHANICS_AITRAVEL_H
|
2013-03-26 18:01:01 +01:00
|
|
|
|
2020-05-17 22:10:36 +02:00
|
|
|
#include "typedaipackage.hpp"
|
2013-05-24 18:16:35 -07:00
|
|
|
|
2014-06-12 23:27:04 +02:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
namespace AiSequence
|
|
|
|
{
|
|
|
|
struct AiTravel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-26 18:01:01 +01:00
|
|
|
namespace MWMechanics
|
2014-06-12 23:27:04 +02:00
|
|
|
{
|
2020-05-16 21:08:39 +02:00
|
|
|
struct AiInternalTravel;
|
|
|
|
|
2014-04-29 23:40:59 -04:00
|
|
|
/// \brief Causes the AI to travel to the specified point
|
2020-05-16 21:08:39 +02:00
|
|
|
class AiTravel : public TypedAiPackage<AiTravel>
|
2013-03-26 18:01:01 +01:00
|
|
|
{
|
2014-06-12 23:27:04 +02:00
|
|
|
public:
|
2020-05-16 21:08:39 +02:00
|
|
|
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 23:27:04 +02:00
|
|
|
AiTravel(const ESM::AiSequence::AiTravel* travel);
|
|
|
|
|
2014-12-31 18:41:57 +01:00
|
|
|
/// Simulates the passing of time
|
2020-05-16 18:56:02 +02:00
|
|
|
void fastForward(const MWWorld::Ptr& actor, AiState& state) final;
|
2014-12-31 18:41:57 +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
|
|
|
|
2020-05-16 18:56:02 +02:00
|
|
|
bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) final;
|
2013-03-26 18:01:01 +01:00
|
|
|
|
2020-05-16 21:52:16 +02:00
|
|
|
static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Travel; }
|
2019-10-31 09:44:40 +04:00
|
|
|
|
2020-05-16 21:08:39 +02:00
|
|
|
static constexpr Options makeDefaultOptions()
|
|
|
|
{
|
|
|
|
AiPackage::Options options;
|
|
|
|
options.mUseVariableSpeed = true;
|
|
|
|
options.mAlwaysActive = true;
|
|
|
|
return options;
|
|
|
|
}
|
2020-01-09 14:11:53 +03:00
|
|
|
|
2020-05-16 18:56:02 +02:00
|
|
|
osg::Vec3f getDestination() const final { return osg::Vec3f(mX, mY, mZ); }
|
2019-10-31 09:44:40 +04:00
|
|
|
|
2013-03-26 18:01:01 +01:00
|
|
|
private:
|
2020-06-02 21:30:46 +02:00
|
|
|
const float mX;
|
|
|
|
const float mY;
|
|
|
|
const float mZ;
|
2017-12-01 19:58:42 +04:00
|
|
|
|
2020-06-02 21:30:46 +02:00
|
|
|
const bool mHidden;
|
2013-03-26 18:01:01 +01:00
|
|
|
};
|
2020-05-16 21:08:39 +02:00
|
|
|
|
|
|
|
struct AiInternalTravel final : public AiTravel
|
|
|
|
{
|
|
|
|
AiInternalTravel(float x, float y, float z);
|
|
|
|
|
|
|
|
explicit AiInternalTravel(const ESM::AiSequence::AiTravel* travel);
|
|
|
|
|
2020-05-16 21:52:16 +02:00
|
|
|
static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::InternalTravel; }
|
2020-05-16 21:08:39 +02:00
|
|
|
|
|
|
|
std::unique_ptr<AiPackage> clone() const final;
|
|
|
|
};
|
2012-11-14 18:42:04 +01:00
|
|
|
}
|
|
|
|
|
2012-11-15 22:15:20 +01:00
|
|
|
#endif
|