Feature #391 Dummy AI package classes

actorid
marcin 12 years ago
parent e6c8e1f0d7
commit 4b939c7521

@ -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

@ -1,25 +1,18 @@
#include "aiescort.hpp"
#include <iostream>
MWMechanics::AiEscort::AiEscort(std::string ActorID,int Duration, float X, float Y, float Z, bool Reset)
{
mActorID = ActorID;
mDuration = Duration;
mX = X;
mY = Y;
mZ = Z;
mReset = 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)
{
}
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()
{

@ -1,21 +1,15 @@
#ifndef AIESCORT_H
#define AIESCORT_H
#ifndef GAME_MWMECHANICS_AIESCORT_H
#define GAME_MWMECHANICS_AIESCORT_H
#include "aipackage.hpp"
#include <iostream>
#include <vector>
namespace MWWorld
{
class Ptr;
}
#include "aipackage.hpp"
#include <string>
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

@ -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;
}

@ -1,36 +0,0 @@
#ifndef AIFALLOW_H
#define AIFALLOW_H
#include "aipackage.hpp"
#include <string>
#include <iostream>
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

@ -1,22 +1,22 @@
#include "aitravel.hpp"
#include <iostream>
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;
}

@ -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 <iostream>
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

@ -1,12 +1,9 @@
#include "aiwander.hpp"
#include <iostream>
MWMechanics::AiWander::AiWander(int distance, int duration, int timeOfDay,std::vector<int> Idle,bool reset)
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;
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;
}

@ -1,15 +1,9 @@
#ifndef AIWANDER_H
#define AIWANDER_H
#ifndef GAME_MWMECHANICS_AIWANDER_H
#define GAME_MWMECHANICS_AIWANDER_H
#include "aipackage.hpp"
#include <iostream>
#include <vector>
namespace MWWorld
{
class Ptr;
}
namespace MWMechanics
{
@ -17,7 +11,7 @@ class AiWander : public AiPackage
{
public:
AiWander(int distance, int duration, int timeOfDay,std::vector<int> Idle,bool reset=false);
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?
@ -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<int> mIdle;
bool mReset;
};
}

Loading…
Cancel
Save