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/LookAtPlayerGoal.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Minecraft.World/LookAtPlayerGoal.h (limited to 'Minecraft.World/LookAtPlayerGoal.h') diff --git a/Minecraft.World/LookAtPlayerGoal.h b/Minecraft.World/LookAtPlayerGoal.h new file mode 100644 index 00000000..bfc524c8 --- /dev/null +++ b/Minecraft.World/LookAtPlayerGoal.h @@ -0,0 +1,32 @@ +#pragma once + +#include "Goal.h" + +class Mob; +class Level; + +class LookAtPlayerGoal : public Goal +{ +private: + Mob *mob; // Owner of this goal + +protected: + weak_ptr lookAt; + +private: + float lookDistance; + int lookTime; + float probability; + const type_info& lookAtType; + +public: + LookAtPlayerGoal(Mob *mob, const type_info& lookAtType, float lookDistance); + LookAtPlayerGoal(Mob *mob, const type_info& lookAtType, float lookDistance, float probability); + virtual ~LookAtPlayerGoal() {} + + virtual bool canUse(); + virtual bool canContinueToUse(); + virtual void start(); + virtual void stop(); + virtual void tick(); +}; \ No newline at end of file -- cgit v1.2.3