refactor(Core/Misc): acore to Acore (#6043)

This commit is contained in:
Kitzunu
2021-05-31 14:21:54 +02:00
committed by GitHub
parent 7eeae6866e
commit 897a02bb75
224 changed files with 942 additions and 942 deletions

View File

@@ -71,8 +71,8 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
me->IsFriendlyTo(victim) || !me->CanSeeOrDetect(victim))
{
victim = nullptr;
acore::NearestAttackableUnitInObjectRangeCheck u_check(me, me, max_range);
acore::UnitLastSearcher<acore::NearestAttackableUnitInObjectRangeCheck> checker(me, victim, u_check);
Acore::NearestAttackableUnitInObjectRangeCheck u_check(me, me, max_range);
Acore::UnitLastSearcher<Acore::NearestAttackableUnitInObjectRangeCheck> checker(me, victim, u_check);
me->VisitNearbyObject(max_range, checker);
}

View File

@@ -28,7 +28,7 @@ enum SelectAggroTarget
};
// default predicate function to select target based on distance, player and/or aura criteria
struct DefaultTargetSelector : public acore::unary_function<Unit*, bool>
struct DefaultTargetSelector : public Acore::unary_function<Unit*, bool>
{
const Unit* me;
float m_dist;
@@ -78,7 +78,7 @@ struct DefaultTargetSelector : public acore::unary_function<Unit*, bool>
// Target selector for spell casts checking range, auras and attributes
// TODO: Add more checks from Spell::CheckCast
struct SpellTargetSelector : public acore::unary_function<Unit*, bool>
struct SpellTargetSelector : public Acore::unary_function<Unit*, bool>
{
public:
SpellTargetSelector(Unit* caster, uint32 spellId);
@@ -92,7 +92,7 @@ private:
// Very simple target selector, will just skip main target
// NOTE: When passing to UnitAI::SelectTarget remember to use 0 as position for random selection
// because tank will not be in the temporary list
struct NonTankTargetSelector : public acore::unary_function<Unit*, bool>
struct NonTankTargetSelector : public Acore::unary_function<Unit*, bool>
{
public:
NonTankTargetSelector(Creature* source, bool playerOnly = true) : _source(source), _playerOnly(playerOnly) { }
@@ -104,7 +104,7 @@ private:
};
// Simple selector for units using mana
struct PowerUsersSelector : public acore::unary_function<Unit*, bool>
struct PowerUsersSelector : public Acore::unary_function<Unit*, bool>
{
Unit const* _me;
Powers const _power;
@@ -134,7 +134,7 @@ struct PowerUsersSelector : public acore::unary_function<Unit*, bool>
}
};
struct FarthestTargetSelector : public acore::unary_function<Unit*, bool>
struct FarthestTargetSelector : public Acore::unary_function<Unit*, bool>
{
FarthestTargetSelector(Unit const* unit, float dist, bool playerOnly, bool inLos) : _me(unit), _dist(dist), _playerOnly(playerOnly), _inLos(inLos) {}
@@ -190,7 +190,7 @@ public:
Unit* SelectTarget(SelectAggroTarget targetType, uint32 position = 0, float dist = 0.0f, bool playerOnly = false, int32 aura = 0);
// Select the targets satifying the predicate.
// predicate shall extend acore::unary_function<Unit*, bool>
// predicate shall extend Acore::unary_function<Unit*, bool>
template <class PREDICATE> Unit* SelectTarget(SelectAggroTarget targetType, uint32 position, PREDICATE const& predicate)
{
ThreatContainer::StorageType const& threatlist = me->getThreatManager().getThreatList();
@@ -206,7 +206,7 @@ public:
return nullptr;
if (targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST)
targetList.sort(acore::ObjectDistanceOrderPred(me));
targetList.sort(Acore::ObjectDistanceOrderPred(me));
switch (targetType)
{
@@ -240,7 +240,7 @@ public:
void SelectTargetList(std::list<Unit*>& targetList, uint32 num, SelectAggroTarget targetType, float dist = 0.0f, bool playerOnly = false, int32 aura = 0);
// Select the targets satifying the predicate.
// predicate shall extend acore::unary_function<Unit*, bool>
// predicate shall extend Acore::unary_function<Unit*, bool>
template <class PREDICATE> void SelectTargetList(std::list<Unit*>& targetList, PREDICATE const& predicate, uint32 maxTargets, SelectAggroTarget targetType)
{
ThreatContainer::StorageType const& threatlist = me->getThreatManager().getThreatList();
@@ -255,13 +255,13 @@ public:
return;
if (targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST)
targetList.sort(acore::ObjectDistanceOrderPred(me));
targetList.sort(Acore::ObjectDistanceOrderPred(me));
if (targetType == SELECT_TARGET_FARTHEST || targetType == SELECT_TARGET_BOTTOMAGGRO)
targetList.reverse();
if (targetType == SELECT_TARGET_RANDOM)
acore::Containers::RandomResize(targetList, maxTargets);
Acore::Containers::RandomResize(targetList, maxTargets);
else
targetList.resize(maxTargets);
}