/* * Copyright (C) 2016+ AzerothCore , released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version. */ #ifndef _PLAYERBOT_TARGETVALUE_H #define _PLAYERBOT_TARGETVALUE_H #include "TravelMgr.h" #include "Value.h" class PlayerbotAI; class ThreatMgr; class Unit; class FindTargetStrategy { public: FindTargetStrategy(PlayerbotAI* botAI) : result(nullptr), botAI(botAI) { } Unit* GetResult(); virtual void CheckAttacker(Unit* attacker, ThreatMgr* threatMgr) = 0; void GetPlayerCount(Unit* creature, uint32* tankCount, uint32* dpsCount); protected: Unit* result; PlayerbotAI* botAI; std::map tankCountCache; std::map dpsCountCache; }; class FindNonCcTargetStrategy : public FindTargetStrategy { public: FindNonCcTargetStrategy(PlayerbotAI* botAI) : FindTargetStrategy(botAI) { } protected: virtual bool IsCcTarget(Unit* attacker); }; class TargetValue : public UnitCalculatedValue { public: TargetValue(PlayerbotAI* botAI, std::string const name = "target") : UnitCalculatedValue(botAI, name) { } protected: Unit* FindTarget(FindTargetStrategy* strategy); }; class RpgTargetValue : public ManualSetValue { public: RpgTargetValue(PlayerbotAI* botAI, std::string const name = "rpg target") : ManualSetValue(botAI, GuidPosition(), name) { } }; class TravelTargetValue : public ManualSetValue { public: TravelTargetValue(PlayerbotAI* botAI, std::string const name = "travel target") : ManualSetValue(botAI, new TravelTarget(botAI), name) { } virtual ~TravelTargetValue() { delete value; } }; class LastLongMoveValue : public CalculatedValue { public: LastLongMoveValue(PlayerbotAI* botAI) : CalculatedValue(botAI, "last long move", 30) { } WorldPosition Calculate() override; }; class HomeBindValue : public CalculatedValue { public: HomeBindValue(PlayerbotAI* botAI) : CalculatedValue(botAI, "home bind", 30) { } WorldPosition Calculate() override; }; class IgnoreRpgTargetValue : public ManualSetValue { public: IgnoreRpgTargetValue(PlayerbotAI* botAI) : ManualSetValue(botAI, data, "ignore rpg targets") { } private: GuidSet data; }; class TalkTargetValue : public ManualSetValue { public: TalkTargetValue(PlayerbotAI* botAI, std::string const name = "talk target") : ManualSetValue(botAI, ObjectGuid::Empty, name) { } }; class PullTargetValue : public ManualSetValue { public: PullTargetValue(PlayerbotAI* botAI, std::string const name = "pull target") : ManualSetValue(botAI, ObjectGuid::Empty, name) { } }; #endif