aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/NearestAttackableTargetGoal.h
blob: a10e9264bfd6a30658bd63cb5f7bf28960da657f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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();
};