various fixes

actorid
Marc Zinnschlag 12 years ago
parent 3dc013ceae
commit a092deaee8

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

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

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

@ -9,21 +9,16 @@ namespace MWMechanics
class AiEscort : public AiPackage
{
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 bool execute (const MWWorld::Ptr& actor);
///< \return Package completed?
///< \return Package completed?
virtual int getTypeId() const;
float getX();
float getY();
float getZ();
std::string getActorID();
int getDuration();
private:
std::string mActorID;
std::string mActorId;
float mX;
float mY;
float mZ;

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

@ -7,10 +7,10 @@
namespace MWMechanics
{
class AiFollow : AiPackage
class AiFollow : public AiPackage
{
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 bool execute (const MWWorld::Ptr& actor);
///< \return Package completed?
@ -21,7 +21,7 @@ namespace MWMechanics
float mX;
float mY;
float mZ;
std::string mActorID;
std::string mActorId;
};
}
#endif

@ -1,8 +1,8 @@
#include "aitravel.hpp"
#include <iostream>
MWMechanics::AiTravel::AiTravel(float x, float y, float z):
mX(x),mY(y),mZ(z)
MWMechanics::AiTravel::AiTravel(float x, float y, float z)
: mX(x),mY(y),mZ(z)
{
}
@ -22,18 +22,4 @@ 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;
}

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

@ -1,26 +1,11 @@
#include "aiwander.hpp"
#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)
{
}
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
{
return new AiWander(*this);
@ -36,8 +21,3 @@ int MWMechanics::AiWander::getTypeId() const
{
return 0;
}
int MWMechanics::AiWander::getIdle(int index) const
{
return mIdle.at(index);
}

@ -11,24 +11,19 @@ namespace MWMechanics
{
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 bool execute (const MWWorld::Ptr& actor);
///< \return Package completed?
virtual int getTypeId() const;
///< 0: Wander
int getDistance() const;
int getDuration()const;
int getTimeOfDay()const;
int getIdle(int index) const;
private:
int mDistance;
int mDuration;
int mTimeOfDay;
int mTimeOfDay;
std::vector<int> mIdle;
};
}
#endif // AIWANDER_H
#endif

Loading…
Cancel
Save