From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.World/NearestAttackableTargetGoal.h | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Minecraft.World/NearestAttackableTargetGoal.h (limited to 'Minecraft.World/NearestAttackableTargetGoal.h') 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 e1, shared_ptr e2); + }; + +private: + weak_ptr 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 -- cgit v1.2.3