1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 06:39:49 +00:00
OpenMW/apps/openmw/mwmechanics/aiwander.hpp

65 lines
1.6 KiB
C++
Raw Normal View History

2012-11-15 21:15:20 +00:00
#ifndef GAME_MWMECHANICS_AIWANDER_H
#define GAME_MWMECHANICS_AIWANDER_H
2012-11-14 17:42:04 +00:00
#include "aipackage.hpp"
#include <vector>
#include "pathfinding.hpp"
#include "../mwworld/timestamp.hpp"
2012-11-14 17:42:04 +00:00
namespace MWMechanics
{
2012-11-16 17:38:15 +00:00
class AiWander : public AiPackage
{
public:
2012-11-14 17:42:04 +00:00
AiWander(int distance, int duration, int timeOfDay, const std::vector<int>& idle, bool repeat);
virtual AiPackage *clone() const;
virtual bool execute (const MWWorld::Ptr& actor);
///< \return Package completed?
virtual int getTypeId() const;
///< 0: Wander
2012-11-14 17:42:04 +00:00
private:
void stopWalking(const MWWorld::Ptr& actor, PathFinder& path);
void playIdle(const MWWorld::Ptr& actor, unsigned short idleSelect);
bool checkIdle(const MWWorld::Ptr& actor, unsigned short idleSelect);
int mDistance;
int mDuration;
int mTimeOfDay;
std::vector<int> mIdle;
bool mRepeat;
float mX;
float mY;
float mZ;
int mCellX;
int mCellY;
float mXCell;
float mYCell;
bool mStoredAvailableNodes;
bool mChooseAction;
bool mIdleNow;
bool mMoveNow;
bool mWalking;
float mChanceMultiplyer;
unsigned short mPlayedIdle;
MWWorld::TimeStamp mStartTime;
std::vector<ESM::Pathgrid::Point> mAllowedNodes;
ESM::Pathgrid::Point mCurrentNode;
PathFinder mPathFinder;
const ESM::Pathgrid *mPathgrid;
2012-11-16 17:38:15 +00:00
};
}
2012-11-14 17:42:04 +00:00
2012-11-16 19:28:20 +00:00
#endif