Files
MinecraftConsoles/Minecraft.World/NearestAttackableTargetGoal.h
void_17 7074f35e4b shared_ptr -> std::shared_ptr
This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today.
2026-03-02 15:58:20 +07:00

36 lines
809 B
C++

#pragma once
#include "TargetGoal.h"
class NearestAttackableTargetGoal : public TargetGoal
{
public:
class DistComp
{
private:
Entity *source;
public:
DistComp(Entity *source);
bool operator() (std::shared_ptr<Entity> e1, std::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();
};