diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index cdfbcc27d..e513c9dd5 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -63,7 +63,7 @@ add_openmw_dir (mwclass add_openmw_dir (mwmechanics mechanicsmanagerimp stat creaturestats magiceffects movement actors drawstate spells - activespells npcstats aipackage aisequence alchemy aiwander aitravel aifallow aiescort + activespells npcstats aipackage aisequence alchemy aiwander aitravel aifollow aiescort aiactivate ) add_openmw_dir (mwbase diff --git a/apps/openmw/mwmechanics/aiescort.cpp b/apps/openmw/mwmechanics/aiescort.cpp index eac5d3bf5..fd7b9bf32 100644 --- a/apps/openmw/mwmechanics/aiescort.cpp +++ b/apps/openmw/mwmechanics/aiescort.cpp @@ -1,25 +1,18 @@ #include "aiescort.hpp" +#include - -MWMechanics::AiEscort::AiEscort(std::string ActorID,int Duration, float X, float Y, float Z, bool Reset) +MWMechanics::AiEscort::AiEscort(const std::string &ActorID,int Duration, float X, float Y, float Z): +mActorID(ActorID), mDuration(Duration), mX(X), mY(Y), mZ(Z) { - 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; + return new AiEscort(*this); } bool MWMechanics::AiEscort::execute (const MWWorld::Ptr& actor) { - std::cout << "AiEscort complted. \n"; + std::cout << "AiEscort completed. \n"; return true; } @@ -40,10 +33,6 @@ float MWMechanics::AiEscort::getZ() { return mZ; } -bool MWMechanics::AiEscort::getReset() -{ - return mReset; -} std::string MWMechanics::AiEscort::getActorID() { diff --git a/apps/openmw/mwmechanics/aiescort.hpp b/apps/openmw/mwmechanics/aiescort.hpp index cc6a1ec29..e39327e04 100644 --- a/apps/openmw/mwmechanics/aiescort.hpp +++ b/apps/openmw/mwmechanics/aiescort.hpp @@ -1,21 +1,15 @@ -#ifndef AIESCORT_H -#define AIESCORT_H +#ifndef GAME_MWMECHANICS_AIESCORT_H +#define GAME_MWMECHANICS_AIESCORT_H -#include "aipackage.hpp" -#include -#include - -namespace MWWorld -{ -class Ptr; -} +#include "aipackage.hpp" +#include namespace MWMechanics { class AiEscort : public AiPackage { public: - AiEscort(std::string ActorID,int Duration, float X, float Y, float Z, bool Reset = false); + AiEscort(const std::string &ActorID,int Duration, float X, float Y, float Z); virtual AiEscort *clone() const; virtual bool execute (const MWWorld::Ptr& actor); @@ -25,7 +19,6 @@ class AiEscort : public AiPackage float getX(); float getY(); float getZ(); - bool getReset(); std::string getActorID(); int getDuration(); @@ -35,7 +28,7 @@ class AiEscort : public AiPackage float mY; float mZ; int mDuration; - bool mReset; + }; } -#endif // AIESCORT_H +#endif diff --git a/apps/openmw/mwmechanics/aifallow.cpp b/apps/openmw/mwmechanics/aifallow.cpp deleted file mode 100644 index 2ba527761..000000000 --- a/apps/openmw/mwmechanics/aifallow.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#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 deleted file mode 100644 index b602bf300..000000000 --- a/apps/openmw/mwmechanics/aifallow.hpp +++ /dev/null @@ -1,36 +0,0 @@ -#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 index a71c85783..d07d30228 100644 --- a/apps/openmw/mwmechanics/aitravel.cpp +++ b/apps/openmw/mwmechanics/aitravel.cpp @@ -1,22 +1,22 @@ #include "aitravel.hpp" +#include -MWMechanics::AiTravel::AiTravel(float x, float y, float z, bool reset) +MWMechanics::AiTravel::AiTravel(float x, float y, float z): +mX(x),mY(y),mZ(z) { - mX = x; - mY = y; - mZ = z; - mReset = reset; } + MWMechanics::AiTravel * MWMechanics::AiTravel::clone() const { - AiTravel * temp = new AiTravel(*this); - return temp; + return new AiTravel(*this); } + bool MWMechanics::AiTravel::execute (const MWWorld::Ptr& actor) { - std::cout << "AiTravel complited. \n"; + std::cout << "AiTravel completed.\n"; return true; } + int MWMechanics::AiTravel::getTypeId() const { return 1; @@ -27,7 +27,6 @@ float MWMechanics::AiTravel::getX() return mX; } - float MWMechanics::AiTravel::getY() { return mY; @@ -38,7 +37,3 @@ 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 index 0503935fd..86032cf54 100644 --- a/apps/openmw/mwmechanics/aitravel.hpp +++ b/apps/openmw/mwmechanics/aitravel.hpp @@ -1,20 +1,14 @@ -#ifndef AITRAVEL_HPP_INCLUDED -#define AITRAVEL_HPP_INCLUDED +#ifndef GAME_MWMECHANICS_AITRAVEL_H +#define GAME_MWMECHANICS_AITRAVEL_H #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); + AiTravel(float x, float y, float z); virtual AiTravel *clone() const; virtual bool execute (const MWWorld::Ptr& actor); @@ -24,14 +18,14 @@ class AiTravel : public AiPackage float getX(); float getY(); float getZ(); - bool getReset(); + private: float mX; float mY; float mZ; - bool mReset; + }; } -#endif // AITRAVEL_HPP_INCLUDED +#endif diff --git a/apps/openmw/mwmechanics/aiwander.cpp b/apps/openmw/mwmechanics/aiwander.cpp index b77b2c04b..ac39fe94d 100644 --- a/apps/openmw/mwmechanics/aiwander.cpp +++ b/apps/openmw/mwmechanics/aiwander.cpp @@ -1,12 +1,9 @@ #include "aiwander.hpp" +#include -MWMechanics::AiWander::AiWander(int distance, int duration, int timeOfDay,std::vector Idle,bool reset) +MWMechanics::AiWander::AiWander(int distance, int duration, int timeOfDay,std::vector Idle): + mDistance(distance), mDuration(duration), mTimeOfDay(timeOfDay), mIdle(Idle) { - mDistance = distance; - mDuration = duration; - mTimeOfDay = timeOfDay; - mIdle = Idle; - mReset = reset; } int MWMechanics::AiWander::getDistance() const @@ -24,11 +21,6 @@ int MWMechanics::AiWander::getTimeOfDay() const return mTimeOfDay; } -bool MWMechanics::AiWander::getReset() const -{ - return mReset; -} - MWMechanics::AiPackage * MWMechanics::AiWander::clone() const { return new AiWander(*this); @@ -36,7 +28,7 @@ MWMechanics::AiPackage * MWMechanics::AiWander::clone() const bool MWMechanics::AiWander::execute (const MWWorld::Ptr& actor) { - std::cout << "AiWadner complited. \n"; + std::cout << "AiWadner completed.\n"; return true; } diff --git a/apps/openmw/mwmechanics/aiwander.hpp b/apps/openmw/mwmechanics/aiwander.hpp index 6ecd7f100..64168042c 100644 --- a/apps/openmw/mwmechanics/aiwander.hpp +++ b/apps/openmw/mwmechanics/aiwander.hpp @@ -1,15 +1,9 @@ -#ifndef AIWANDER_H -#define AIWANDER_H +#ifndef GAME_MWMECHANICS_AIWANDER_H +#define GAME_MWMECHANICS_AIWANDER_H #include "aipackage.hpp" -#include #include -namespace MWWorld -{ -class Ptr; -} - namespace MWMechanics { @@ -17,7 +11,7 @@ class AiWander : public AiPackage { public: - AiWander(int distance, int duration, int timeOfDay,std::vector Idle,bool reset=false); + AiWander(int distance, int duration, int timeOfDay,std::vector Idle); virtual AiPackage *clone() const; virtual bool execute (const MWWorld::Ptr& actor); ///< \return Package completed? @@ -27,7 +21,6 @@ public: int getDistance() const; int getDuration()const; int getTimeOfDay()const; - bool getReset()const; int getIdle(int index) const; private: @@ -35,7 +28,6 @@ private: int mDuration; int mTimeOfDay; std::vector mIdle; - bool mReset; }; }