Feature #391 Dummy AI package classes

actorid
marcin 12 years ago
parent bed0280ba1
commit 51027c541e

@ -1,9 +1,9 @@
#include "aiactivate.hpp"
#include <iostream>
MWMechanics::AiActivate::AiActivate(const MWWorld::Ptr& object)
MWMechanics::AiActivate::AiActivate(const std::string &objectID):
mObjectID(objectID)
{
mObject = &object;
}
MWMechanics::AiActivate *MWMechanics::AiActivate::clone() const
{

@ -2,22 +2,22 @@
#define GAME_MWMECHANICS_AIACTIVATE_H
#include "aipackage.hpp"
#include <string>
namespace MWMechanics
{
class AiActivate : AiPackage
{
public:
AiActivate(const MWWorld::Ptr& object);
virtual AiActivate *clone() const;
virtual bool execute (const MWWorld::Ptr& actor);
///< \return Package completed?
virtual int getTypeId() const;
class AiActivate : AiPackage
{
public:
AiActivate(const std::string &objectID);
virtual AiActivate *clone() const;
virtual bool execute (const MWWorld::Ptr& actor);
///< \return Package completed?
virtual int getTypeId() const;
private:
const MWWorld::Ptr * mObject;
};
private:
std::string mObjectID;
};
}
#endif // GAME_MWMECHANICS_AIACTIVATE_H

@ -1,8 +1,8 @@
#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), mDuration(duration), mX(x), mY(y), mZ(z)
{
}
MWMechanics::AiEscort *MWMechanics::AiEscort::clone() const

@ -6,29 +6,29 @@
namespace MWMechanics
{
class AiEscort : public AiPackage
{
public:
AiEscort(const std::string &ActorID,int Duration, float X, float Y, float Z);
virtual AiEscort *clone() const;
class AiEscort : public AiPackage
{
public:
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?
virtual bool execute (const MWWorld::Ptr& actor);
///< \return Package completed?
virtual int getTypeId() const;
float getX();
float getY();
float getZ();
std::string getActorID();
int getDuration();
virtual int getTypeId() const;
float getX();
float getY();
float getZ();
std::string getActorID();
int getDuration();
private:
std::string mActorID;
float mX;
float mY;
float mZ;
int mDuration;
private:
std::string mActorID;
float mX;
float mY;
float mZ;
int mDuration;
};
};
}
#endif

@ -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):
mActorID(actorID), mDuration(duration), mX(x), mY(y), mZ(z)
{
}
MWMechanics::AiFollow *MWMechanics::AiFollow::clone() const

@ -7,21 +7,21 @@
namespace MWMechanics
{
class AiFollow : AiPackage
{
public:
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?
virtual int getTypeId() const;
class AiFollow : AiPackage
{
public:
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?
virtual int getTypeId() const;
private:
float mDuration;
float mX;
float mY;
float mZ;
std::string mActorID;
};
private:
float mDuration;
float mX;
float mY;
float mZ;
std::string mActorID;
};
}
#endif

@ -5,27 +5,27 @@
namespace MWMechanics
{
class AiTravel : public AiPackage
{
public:
AiTravel(float x, float y, float z);
virtual AiTravel *clone() const;
class AiTravel : public AiPackage
{
public:
AiTravel(float x, float y, float z);
virtual AiTravel *clone() const;
virtual bool execute (const MWWorld::Ptr& actor);
///< \return Package completed?
virtual bool execute (const MWWorld::Ptr& actor);
///< \return Package completed?
virtual int getTypeId() const;
float getX();
float getY();
float getZ();
virtual int getTypeId() const;
float getX();
float getY();
float getZ();
private:
float mX;
float mY;
float mZ;
private:
float mX;
float mY;
float mZ;
};
};
}
#endif

@ -1,8 +1,8 @@
#include "aiwander.hpp"
#include <iostream>
MWMechanics::AiWander::AiWander(int distance, int duration, int timeOfDay,std::vector<int> Idle):
mDistance(distance), mDuration(duration), mTimeOfDay(timeOfDay), mIdle(Idle)
MWMechanics::AiWander::AiWander(int distance, int duration, int timeOfDay,std::vector<int> idle):
mDistance(distance), mDuration(duration), mTimeOfDay(timeOfDay), mIdle(idle)
{
}
@ -39,7 +39,5 @@ int MWMechanics::AiWander::getTypeId() const
int MWMechanics::AiWander::getIdle(int index) const
{
if(index < 0 || (uint)index > mIdle.size())
return -1;
return mIdle.at(index);
}

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

Loading…
Cancel
Save