1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:23:52 +00:00

various fixes

This commit is contained in:
Marc Zinnschlag 2012-11-16 20:28:20 +01:00
parent 3dc013ceae
commit a092deaee8
10 changed files with 22 additions and 91 deletions

View file

@ -1,8 +1,8 @@
#include "aiactivate.hpp" #include "aiactivate.hpp"
#include <iostream> #include <iostream>
MWMechanics::AiActivate::AiActivate(const std::string &objectID): MWMechanics::AiActivate::AiActivate(const std::string &objectId)
mObjectID(objectID) : mObjectId(objectId)
{ {
} }
MWMechanics::AiActivate *MWMechanics::AiActivate::clone() const MWMechanics::AiActivate *MWMechanics::AiActivate::clone() const

View file

@ -7,17 +7,17 @@
namespace MWMechanics namespace MWMechanics
{ {
class AiActivate : AiPackage class AiActivate : public AiPackage
{ {
public: public:
AiActivate(const std::string &objectID); AiActivate(const std::string &objectId);
virtual AiActivate *clone() const; virtual AiActivate *clone() const;
virtual bool execute (const MWWorld::Ptr& actor); virtual bool execute (const MWWorld::Ptr& actor);
///< \return Package completed? ///< \return Package completed?
virtual int getTypeId() const; virtual int getTypeId() const;
private: private:
std::string mObjectID; std::string mObjectId;
}; };
} }
#endif // GAME_MWMECHANICS_AIACTIVATE_H #endif // GAME_MWMECHANICS_AIACTIVATE_H

View file

@ -1,10 +1,11 @@
#include "aiescort.hpp" #include "aiescort.hpp"
#include <iostream> #include <iostream>
MWMechanics::AiEscort::AiEscort(const std::string &actorID,int duration, float x, float y, float z): 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), mX(x), mY(y), mZ(z), mDuration(duration)
{ {
} }
MWMechanics::AiEscort *MWMechanics::AiEscort::clone() const MWMechanics::AiEscort *MWMechanics::AiEscort::clone() const
{ {
return new AiEscort(*this); return new AiEscort(*this);
@ -21,25 +22,3 @@ int MWMechanics::AiEscort::getTypeId() const
return 2; return 2;
} }
float MWMechanics::AiEscort::getX()
{
return mX;
}
float MWMechanics::AiEscort::getY()
{
return mY;
}
float MWMechanics::AiEscort::getZ()
{
return mZ;
}
std::string MWMechanics::AiEscort::getActorID()
{
return mActorID;
}
int MWMechanics::AiEscort::getDuration()
{
return mDuration;
}

View file

@ -9,21 +9,16 @@ namespace MWMechanics
class AiEscort : public AiPackage class AiEscort : public AiPackage
{ {
public: public:
AiEscort(const std::string &actorID,int duration, float x, float y, float z); AiEscort(const std::string &actorId,int duration, float x, float y, float z);
virtual AiEscort *clone() const; virtual AiEscort *clone() const;
virtual bool execute (const MWWorld::Ptr& actor); virtual bool execute (const MWWorld::Ptr& actor);
///< \return Package completed? ///< \return Package completed?
virtual int getTypeId() const; virtual int getTypeId() const;
float getX();
float getY();
float getZ();
std::string getActorID();
int getDuration();
private: private:
std::string mActorID; std::string mActorId;
float mX; float mX;
float mY; float mY;
float mZ; float mZ;

View file

@ -1,8 +1,8 @@
#include "aifollow.hpp" #include "aifollow.hpp"
#include <iostream> #include <iostream>
MWMechanics::AiFollow::AiFollow(const std::string &actorID,float duration, float x, float y, float z): MWMechanics::AiFollow::AiFollow(const std::string &actorId,float duration, float x, float y, float z)
mActorID(actorID), mDuration(duration), mX(x), mY(y), mZ(z) : mDuration(duration), mX(x), mY(y), mZ(z), mActorId(actorId)
{ {
} }
MWMechanics::AiFollow *MWMechanics::AiFollow::clone() const MWMechanics::AiFollow *MWMechanics::AiFollow::clone() const

View file

@ -7,10 +7,10 @@
namespace MWMechanics namespace MWMechanics
{ {
class AiFollow : AiPackage class AiFollow : public AiPackage
{ {
public: public:
AiFollow(const std::string &ActorID,float duration, float X, float Y, float Z); AiFollow(const std::string &ActorId,float duration, float X, float Y, float Z);
virtual AiFollow *clone() const; virtual AiFollow *clone() const;
virtual bool execute (const MWWorld::Ptr& actor); virtual bool execute (const MWWorld::Ptr& actor);
///< \return Package completed? ///< \return Package completed?
@ -21,7 +21,7 @@ namespace MWMechanics
float mX; float mX;
float mY; float mY;
float mZ; float mZ;
std::string mActorID; std::string mActorId;
}; };
} }
#endif #endif

View file

@ -1,8 +1,8 @@
#include "aitravel.hpp" #include "aitravel.hpp"
#include <iostream> #include <iostream>
MWMechanics::AiTravel::AiTravel(float x, float y, float z): MWMechanics::AiTravel::AiTravel(float x, float y, float z)
mX(x),mY(y),mZ(z) : mX(x),mY(y),mZ(z)
{ {
} }
@ -22,18 +22,4 @@ int MWMechanics::AiTravel::getTypeId() const
return 1; return 1;
} }
float MWMechanics::AiTravel::getX()
{
return mX;
}
float MWMechanics::AiTravel::getY()
{
return mY;
}
float MWMechanics::AiTravel::getZ()
{
return mZ;
}

View file

@ -15,10 +15,6 @@ namespace MWMechanics
///< \return Package completed? ///< \return Package completed?
virtual int getTypeId() const; virtual int getTypeId() const;
float getX();
float getY();
float getZ();
private: private:
float mX; float mX;

View file

@ -1,26 +1,11 @@
#include "aiwander.hpp" #include "aiwander.hpp"
#include <iostream> #include <iostream>
MWMechanics::AiWander::AiWander(int distance, int duration, int timeOfDay,std::vector<int> idle): MWMechanics::AiWander::AiWander(int distance, int duration, int timeOfDay, const std::vector<int>& idle):
mDistance(distance), mDuration(duration), mTimeOfDay(timeOfDay), mIdle(idle) mDistance(distance), mDuration(duration), mTimeOfDay(timeOfDay), mIdle(idle)
{ {
} }
int MWMechanics::AiWander::getDistance() const
{
return mDistance;
}
int MWMechanics::AiWander::getDuration() const
{
return mDuration;
}
int MWMechanics::AiWander::getTimeOfDay() const
{
return mTimeOfDay;
}
MWMechanics::AiPackage * MWMechanics::AiWander::clone() const MWMechanics::AiPackage * MWMechanics::AiWander::clone() const
{ {
return new AiWander(*this); return new AiWander(*this);
@ -36,8 +21,3 @@ int MWMechanics::AiWander::getTypeId() const
{ {
return 0; return 0;
} }
int MWMechanics::AiWander::getIdle(int index) const
{
return mIdle.at(index);
}

View file

@ -11,24 +11,19 @@ namespace MWMechanics
{ {
public: public:
AiWander(int distance, int duration, int timeOfDay,std::vector<int> idle); AiWander(int distance, int duration, int timeOfDay, const std::vector<int>& idle);
virtual AiPackage *clone() const; virtual AiPackage *clone() const;
virtual bool execute (const MWWorld::Ptr& actor); virtual bool execute (const MWWorld::Ptr& actor);
///< \return Package completed? ///< \return Package completed?
virtual int getTypeId() const; virtual int getTypeId() const;
///< 0: Wander ///< 0: Wander
int getDistance() const;
int getDuration()const;
int getTimeOfDay()const;
int getIdle(int index) const;
private: private:
int mDistance; int mDistance;
int mDuration; int mDuration;
int mTimeOfDay; int mTimeOfDay;
std::vector<int> mIdle; std::vector<int> mIdle;
}; };
} }
#endif // AIWANDER_H #endif