aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/NearestAttackableTargetGoal.h
diff options
context:
space:
mode:
Diffstat (limited to 'Minecraft.World/NearestAttackableTargetGoal.h')
-rw-r--r--Minecraft.World/NearestAttackableTargetGoal.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/Minecraft.World/NearestAttackableTargetGoal.h b/Minecraft.World/NearestAttackableTargetGoal.h
new file mode 100644
index 00000000..a10e9264
--- /dev/null
+++ b/Minecraft.World/NearestAttackableTargetGoal.h
@@ -0,0 +1,36 @@
+#pragma once
+
+#include "TargetGoal.h"
+
+class NearestAttackableTargetGoal : public TargetGoal
+{
+public:
+ class DistComp
+ {
+ private:
+ Entity *source;
+
+ public:
+ DistComp(Entity *source);
+
+ bool operator() (shared_ptr<Entity> e1, shared_ptr<Entity> e2);
+ };
+
+private:
+ weak_ptr<Mob> target;
+ const type_info& targetType;
+ int randomInterval;
+ DistComp *distComp;
+
+public:
+ //public NearestAttackableTargetGoal(Mob mob, const type_info& targetType, float within, int randomInterval, bool mustSee)
+ //{
+ // this(mob, targetType, within, randomInterval, mustSee, false);
+ //}
+
+ NearestAttackableTargetGoal(Mob *mob, const type_info& targetType, float within, int randomInterval, bool mustSee, bool mustReach = false);
+ virtual ~NearestAttackableTargetGoal();
+
+ virtual bool canUse();
+ void start();
+}; \ No newline at end of file