diff --git a/apps/openmw/mwmechanics/aiescort.cpp b/apps/openmw/mwmechanics/aiescort.cpp new file mode 100644 index 0000000000..eac5d3bf5f --- /dev/null +++ b/apps/openmw/mwmechanics/aiescort.cpp @@ -0,0 +1,56 @@ +#include "aiescort.hpp" + + +MWMechanics::AiEscort::AiEscort(std::string ActorID,int Duration, float X, float Y, float Z, bool Reset) +{ + mActorID = ActorID; + mDuration = Duration; + mX = X; + mY = Y; + mZ = Z; + mReset = Reset; + +} +MWMechanics::AiEscort *MWMechanics::AiEscort::clone() const +{ + AiEscort * temp = new AiEscort(*this); + return temp; +} + +bool MWMechanics::AiEscort::execute (const MWWorld::Ptr& actor) +{ + std::cout << "AiEscort complted. \n"; + return true; +} + +int MWMechanics::AiEscort::getTypeId() const +{ + return 2; +} + +float MWMechanics::AiEscort::getX() +{ + return mX; +} +float MWMechanics::AiEscort::getY() +{ + return mY; +} +float MWMechanics::AiEscort::getZ() +{ + return mZ; +} +bool MWMechanics::AiEscort::getReset() +{ + return mReset; +} + +std::string MWMechanics::AiEscort::getActorID() +{ + return mActorID; +} + +int MWMechanics::AiEscort::getDuration() +{ + return mDuration; +} diff --git a/apps/openmw/mwmechanics/aiescort.hpp b/apps/openmw/mwmechanics/aiescort.hpp new file mode 100644 index 0000000000..cc6a1ec297 --- /dev/null +++ b/apps/openmw/mwmechanics/aiescort.hpp @@ -0,0 +1,41 @@ +#ifndef AIESCORT_H +#define AIESCORT_H + +#include "aipackage.hpp" +#include +#include + +namespace MWWorld +{ +class Ptr; +} + +namespace MWMechanics +{ +class AiEscort : public AiPackage +{ + public: + AiEscort(std::string ActorID,int Duration, float X, float Y, float Z, bool Reset = false); + virtual AiEscort *clone() const; + + virtual bool execute (const MWWorld::Ptr& actor); + ///< \return Package completed? + + virtual int getTypeId() const; + float getX(); + float getY(); + float getZ(); + bool getReset(); + std::string getActorID(); + int getDuration(); + + private: + std::string mActorID; + float mX; + float mY; + float mZ; + int mDuration; + bool mReset; +}; +} +#endif // AIESCORT_H diff --git a/apps/openmw/mwmechanics/aifallow.cpp b/apps/openmw/mwmechanics/aifallow.cpp new file mode 100644 index 0000000000..2ba5277618 --- /dev/null +++ b/apps/openmw/mwmechanics/aifallow.cpp @@ -0,0 +1,27 @@ +#include "aifallow.hpp" + +MWMechanics::AiFallow::AiFallow(std::string ActorID,float duration, float X, float Y, float Z, bool Reset) +{ + mActorID = ActorID; + mDuration = duration; + mX = X; + mY = Y; + mZ = Z; + mReset = Reset; +} +MWMechanics::AiFallow *MWMechanics::AiFallow::clone() const +{ + AiFallow * temp = new AiFallow(*this); + return temp; +} + + bool MWMechanics::AiFallow::execute (const MWWorld::Ptr& actor) +{ + std::cout << "AiFallow complited. \n"; + return true; +} + + int MWMechanics::AiFallow::getTypeId() const +{ + return 3; +} diff --git a/apps/openmw/mwmechanics/aifallow.hpp b/apps/openmw/mwmechanics/aifallow.hpp new file mode 100644 index 0000000000..b602bf300f --- /dev/null +++ b/apps/openmw/mwmechanics/aifallow.hpp @@ -0,0 +1,36 @@ +#ifndef AIFALLOW_H +#define AIFALLOW_H + +#include "aipackage.hpp" +#include +#include + +namespace MWWorld +{ +class Ptr; +} + +namespace MWMechanics +{ + +class AiFallow : AiPackage +{ + public: + AiFallow(std::string ActorID,float duration, float X, float Y, float Z, bool Reset = false); + virtual AiFallow *clone() const; + + virtual bool execute (const MWWorld::Ptr& actor); + ///< \return Package completed? + + virtual int getTypeId() const; + ///< 0: Wanter, 1 Travel, 2 Escort, 3 Follo + private: + float mDuration; + float mX; + float mY; + float mZ; + bool mReset; + std::string mActorID; +}; +} +#endif // AIFALLOW_H diff --git a/apps/openmw/mwmechanics/aitravel.cpp b/apps/openmw/mwmechanics/aitravel.cpp new file mode 100644 index 0000000000..a71c857834 --- /dev/null +++ b/apps/openmw/mwmechanics/aitravel.cpp @@ -0,0 +1,44 @@ +#include "aitravel.hpp" + +MWMechanics::AiTravel::AiTravel(float x, float y, float z, bool reset) +{ + mX = x; + mY = y; + mZ = z; + mReset = reset; +} +MWMechanics::AiTravel * MWMechanics::AiTravel::clone() const +{ + AiTravel * temp = new AiTravel(*this); + return temp; +} +bool MWMechanics::AiTravel::execute (const MWWorld::Ptr& actor) +{ + std::cout << "AiTravel complited. \n"; + return true; +} +int MWMechanics::AiTravel::getTypeId() const +{ + return 1; +} + +float MWMechanics::AiTravel::getX() +{ + return mX; +} + + +float MWMechanics::AiTravel::getY() +{ + return mY; +} + +float MWMechanics::AiTravel::getZ() +{ + return mZ; +} + +bool MWMechanics::AiTravel::getReset() +{ + return mReset; +} diff --git a/apps/openmw/mwmechanics/aitravel.hpp b/apps/openmw/mwmechanics/aitravel.hpp new file mode 100644 index 0000000000..0503935fd4 --- /dev/null +++ b/apps/openmw/mwmechanics/aitravel.hpp @@ -0,0 +1,37 @@ +#ifndef AITRAVEL_HPP_INCLUDED +#define AITRAVEL_HPP_INCLUDED + +#include "aipackage.hpp" +#include + +namespace MWWorld +{ +class Ptr; +} + +namespace MWMechanics +{ +class AiTravel : public AiPackage +{ + public: + AiTravel(float x, float y, float z, bool reset = false); + virtual AiTravel *clone() const; + + virtual bool execute (const MWWorld::Ptr& actor); + ///< \return Package completed? + + virtual int getTypeId() const; + float getX(); + float getY(); + float getZ(); + bool getReset(); + + private: + float mX; + float mY; + float mZ; + bool mReset; +}; +} + +#endif // AITRAVEL_HPP_INCLUDED diff --git a/apps/openmw/mwmechanics/aiwander.cpp b/apps/openmw/mwmechanics/aiwander.cpp new file mode 100644 index 0000000000..b77b2c04bc --- /dev/null +++ b/apps/openmw/mwmechanics/aiwander.cpp @@ -0,0 +1,55 @@ +#include "aiwander.hpp" + +MWMechanics::AiWander::AiWander(int distance, int duration, int timeOfDay,std::vector Idle,bool reset) +{ + mDistance = distance; + mDuration = duration; + mTimeOfDay = timeOfDay; + mIdle = Idle; + mReset = reset; +} + +int MWMechanics::AiWander::getDistance() const +{ + return mDistance; +} + +int MWMechanics::AiWander::getDuration() const +{ + return mDuration; +} + +int MWMechanics::AiWander::getTimeOfDay() const +{ + return mTimeOfDay; +} + +bool MWMechanics::AiWander::getReset() const +{ + return mReset; +} + +MWMechanics::AiPackage * MWMechanics::AiWander::clone() const +{ + return new AiWander(*this); +} + +bool MWMechanics::AiWander::execute (const MWWorld::Ptr& actor) +{ + std::cout << "AiWadner complited. \n"; + return true; +} + +int MWMechanics::AiWander::getTypeId() const +{ + return 0; +} + +int MWMechanics::AiWander::getIdle(int index) const +{ + if(index < 0 || (uint)index > mIdle.size()) + return -1; + int temp; + temp = mIdle.at(index); + return temp; +} diff --git a/apps/openmw/mwmechanics/aiwander.hpp b/apps/openmw/mwmechanics/aiwander.hpp new file mode 100644 index 0000000000..6ecd7f1008 --- /dev/null +++ b/apps/openmw/mwmechanics/aiwander.hpp @@ -0,0 +1,42 @@ +#ifndef AIWANDER_H +#define AIWANDER_H + +#include "aipackage.hpp" +#include +#include + +namespace MWWorld +{ +class Ptr; +} + +namespace MWMechanics +{ + +class AiWander : public AiPackage +{ +public: + + AiWander(int distance, int duration, int timeOfDay,std::vector Idle,bool reset=false); + virtual AiPackage *clone() const; + virtual bool execute (const MWWorld::Ptr& actor); + ///< \return Package completed? + virtual int getTypeId() const; + ///< 0: Wander + + int getDistance() const; + int getDuration()const; + int getTimeOfDay()const; + bool getReset()const; + int getIdle(int index) const; + +private: + int mDistance; + int mDuration; + int mTimeOfDay; + std::vector mIdle; + bool mReset; +}; +} + +#endif // AIWANDER_H