mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-04-06 15:33:32 +00:00
66 lines
1.4 KiB
C++
Executable File
66 lines
1.4 KiB
C++
Executable File
#ifndef NET_MINECRAFT_WORLD_ENTITY__PathfinderMob_H__
|
|
#define NET_MINECRAFT_WORLD_ENTITY__PathfinderMob_H__
|
|
|
|
//package net.minecraft.world.entity;
|
|
|
|
#include "Mob.h"
|
|
#include "ai/PathNavigation.h"
|
|
#include "../level/pathfinder/Path.h"
|
|
|
|
class Level;
|
|
class Sensing;
|
|
|
|
typedef struct AIData {
|
|
AIData():
|
|
target(NULL)
|
|
{}
|
|
|
|
Mob* target;
|
|
} AIData;
|
|
|
|
class PathfinderMob: public Mob
|
|
{
|
|
typedef Mob super;
|
|
static const int MAX_TURN = 30;
|
|
public:
|
|
PathfinderMob(Level* level);
|
|
~PathfinderMob();
|
|
|
|
bool canSpawn();
|
|
|
|
bool isPathFinding();
|
|
void setPath(Path& path);
|
|
|
|
virtual Entity* getAttackTarget();
|
|
virtual void setAttackTarget(Entity* attacker);
|
|
|
|
virtual float getWalkTargetValue(int x, int y, int z);
|
|
int getNoActionTime();
|
|
|
|
PathNavigation* getNavigation();
|
|
protected:
|
|
virtual Entity* findAttackTarget();
|
|
|
|
virtual void checkHurtTarget(Entity* target, float d);
|
|
virtual void checkCantSeeTarget(Entity* target, float d);
|
|
|
|
virtual float getWalkingSpeedModifier();
|
|
|
|
virtual bool shouldHoldGround();
|
|
|
|
void updateAi();
|
|
|
|
virtual void findRandomStrollLocation();
|
|
int attackTargetId;
|
|
bool holdGround;
|
|
int fleeTime;
|
|
public:
|
|
static const int CAN_OPEN_DOORS = 1;
|
|
static const int AVOID_WATER = 2;
|
|
//int pathfinderMask;
|
|
private:
|
|
Path path;
|
|
};
|
|
|
|
#endif /*NET_MINECRAFT_WORLD_ENTITY__PathfinderMob_H__*/
|