mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 10:06:42 +00:00
Feature #391 Dummy AI package classes
This commit is contained in:
parent
bed0280ba1
commit
51027c541e
9 changed files with 91 additions and 93 deletions
|
@ -1,9 +1,9 @@
|
||||||
#include "aiactivate.hpp"
|
#include "aiactivate.hpp"
|
||||||
#include <iostream>
|
#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
|
MWMechanics::AiActivate *MWMechanics::AiActivate::clone() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,22 +2,22 @@
|
||||||
#define GAME_MWMECHANICS_AIACTIVATE_H
|
#define GAME_MWMECHANICS_AIACTIVATE_H
|
||||||
|
|
||||||
#include "aipackage.hpp"
|
#include "aipackage.hpp"
|
||||||
|
#include <string>
|
||||||
|
|
||||||
namespace MWMechanics
|
namespace MWMechanics
|
||||||
{
|
{
|
||||||
|
|
||||||
class AiActivate : AiPackage
|
class AiActivate : AiPackage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AiActivate(const MWWorld::Ptr& object);
|
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:
|
||||||
const MWWorld::Ptr * mObject;
|
std::string mObjectID;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif // GAME_MWMECHANICS_AIACTIVATE_H
|
#endif // GAME_MWMECHANICS_AIACTIVATE_H
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#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), mDuration(duration), mX(x), mY(y), mZ(z)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
MWMechanics::AiEscort *MWMechanics::AiEscort::clone() const
|
MWMechanics::AiEscort *MWMechanics::AiEscort::clone() const
|
||||||
|
|
|
@ -6,29 +6,29 @@
|
||||||
|
|
||||||
namespace MWMechanics
|
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 getX();
|
||||||
float getY();
|
float getY();
|
||||||
float getZ();
|
float getZ();
|
||||||
std::string getActorID();
|
std::string getActorID();
|
||||||
int getDuration();
|
int getDuration();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string mActorID;
|
std::string mActorID;
|
||||||
float mX;
|
float mX;
|
||||||
float mY;
|
float mY;
|
||||||
float mZ;
|
float mZ;
|
||||||
int mDuration;
|
int mDuration;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -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)
|
mActorID(actorID), mDuration(duration), mX(x), mY(y), mZ(z)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
MWMechanics::AiFollow *MWMechanics::AiFollow::clone() const
|
MWMechanics::AiFollow *MWMechanics::AiFollow::clone() const
|
||||||
|
|
|
@ -7,21 +7,21 @@
|
||||||
namespace MWMechanics
|
namespace MWMechanics
|
||||||
{
|
{
|
||||||
|
|
||||||
class AiFollow : AiPackage
|
class AiFollow : 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?
|
||||||
virtual int getTypeId() const;
|
virtual int getTypeId() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float mDuration;
|
float mDuration;
|
||||||
float mX;
|
float mX;
|
||||||
float mY;
|
float mY;
|
||||||
float mZ;
|
float mZ;
|
||||||
std::string mActorID;
|
std::string mActorID;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -5,27 +5,27 @@
|
||||||
|
|
||||||
namespace MWMechanics
|
namespace MWMechanics
|
||||||
{
|
{
|
||||||
class AiTravel : public AiPackage
|
class AiTravel : public AiPackage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AiTravel(float x, float y, float z);
|
AiTravel(float x, float y, float z);
|
||||||
virtual AiTravel *clone() const;
|
virtual AiTravel *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 getX();
|
||||||
float getY();
|
float getY();
|
||||||
float getZ();
|
float getZ();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float mX;
|
float mX;
|
||||||
float mY;
|
float mY;
|
||||||
float mZ;
|
float mZ;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#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,std::vector<int> idle):
|
||||||
mDistance(distance), mDuration(duration), mTimeOfDay(timeOfDay), mIdle(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
|
int MWMechanics::AiWander::getIdle(int index) const
|
||||||
{
|
{
|
||||||
if(index < 0 || (uint)index > mIdle.size())
|
|
||||||
return -1;
|
|
||||||
return mIdle.at(index);
|
return mIdle.at(index);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,28 +7,28 @@
|
||||||
namespace MWMechanics
|
namespace MWMechanics
|
||||||
{
|
{
|
||||||
|
|
||||||
class AiWander : public AiPackage
|
class AiWander : public AiPackage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
AiWander(int distance, int duration, int timeOfDay,std::vector<int> Idle);
|
AiWander(int distance, int duration, int timeOfDay,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 getDistance() const;
|
||||||
int getDuration()const;
|
int getDuration()const;
|
||||||
int getTimeOfDay()const;
|
int getTimeOfDay()const;
|
||||||
int getIdle(int index) 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 // AIWANDER_H
|
||||||
|
|
Loading…
Reference in a new issue