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

@@ -125,7 +125,7 @@ public:
if (targets.empty())
return;
WorldObject* target = acore::Containers::SelectRandomContainerElement(targets);
WorldObject* target = Acore::Containers::SelectRandomContainerElement(targets);
targets.clear();
targets.push_back(target);
}

View File

@@ -91,7 +91,7 @@ public:
{
std::list<Creature*> healers = DoFindFriendlyMissingBuff(45.0f, SPELL_INSPIRE);
if (!healers.empty())
DoCast(acore::Containers::SelectRandomContainerElement(healers), SPELL_INSPIRE);
DoCast(Acore::Containers::SelectRandomContainerElement(healers), SPELL_INSPIRE);
DoCast(me, SPELL_INSPIRE);
events.ScheduleEvent(EVENT_INSPIRE, urand(20000, 26000));

View File

@@ -165,7 +165,7 @@ public:
if (Creature* summon = ObjectAccessor::GetCreature(*me, *i))
guestList.push_back(summon);
return acore::Containers::SelectRandomContainerElement(guestList);
return Acore::Containers::SelectRandomContainerElement(guestList);
}
void UpdateAI(uint32 diff) override

View File

@@ -294,7 +294,7 @@ public:
}
else
{
point = acore::Containers::SelectRandomContainerElement(positions);
point = Acore::Containers::SelectRandomContainerElement(positions);
pos.Relocate(point->x, point->y, INFERNAL_Z, frand(0.0f, float(M_PI * 2)));
}

View File

@@ -104,7 +104,7 @@ public:
std::list<uint32> helpersList;
for (uint8 i = 0; i < MAX_HELPERS_COUNT; ++i)
helpersList.push_back(helpersEntries[i]);
acore::Containers::RandomResize(helpersList, MAX_ACTIVE_HELPERS);
Acore::Containers::RandomResize(helpersList, MAX_ACTIVE_HELPERS);
uint8 j = 0;
for (std::list<uint32>::const_iterator itr = helpersList.begin(); itr != helpersList.end(); ++itr, ++j)
@@ -199,7 +199,7 @@ public:
case EVENT_SPELL_PW_SHIELD:
{
std::list<Creature*> cList = DoFindFriendlyMissingBuff(40.0f, DUNGEON_MODE(SPELL_POWER_WORD_SHIELD_N, SPELL_POWER_WORD_SHIELD_H));
if (Unit* target = acore::Containers::SelectRandomContainerElement(cList))
if (Unit* target = Acore::Containers::SelectRandomContainerElement(cList))
me->CastSpell(target, DUNGEON_MODE(SPELL_POWER_WORD_SHIELD_N, SPELL_POWER_WORD_SHIELD_H), false);
events.ScheduleEvent(EVENT_SPELL_PW_SHIELD, 10000);
break;
@@ -216,7 +216,7 @@ public:
target = me;
break;
case 2:
target = ObjectAccessor::GetCreature(*me, acore::Containers::SelectRandomContainerElement(summons));
target = ObjectAccessor::GetCreature(*me, Acore::Containers::SelectRandomContainerElement(summons));
break;
}

View File

@@ -626,7 +626,7 @@ public:
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(SpectralBlastCheck(GetCaster()->GetVictim()));
acore::Containers::RandomResize(targets, 1);
Acore::Containers::RandomResize(targets, 1);
}
void HandleDummy(SpellEffIndex effIndex)

View File

@@ -1052,7 +1052,7 @@ public:
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(acore::UnitAuraCheck(true, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT));
targets.remove_if(Acore::UnitAuraCheck(true, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT));
}
void HandleScriptEffect(SpellEffIndex effIndex)
@@ -1089,7 +1089,7 @@ public:
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.sort(acore::ObjectDistanceOrderPred(GetCaster()));
targets.sort(Acore::ObjectDistanceOrderPred(GetCaster()));
WorldObject* target = targets.front();
targets.clear();
@@ -1299,7 +1299,7 @@ public:
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(acore::UnitAuraCheck(true, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT));
targets.remove_if(Acore::UnitAuraCheck(true, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT));
}
void Register() override

View File

@@ -394,7 +394,7 @@ public:
void FilterTargets(std::list<WorldObject*>& targets)
{
acore::Containers::RandomResize(targets, GetCaster()->GetAI()->GetData(DATA_NEGATIVE_ENERGY_TARGETS));
Acore::Containers::RandomResize(targets, GetCaster()->GetAI()->GetData(DATA_NEGATIVE_ENERGY_TARGETS));
}
void HandleScriptEffect(SpellEffIndex effIndex)

View File

@@ -149,18 +149,18 @@ public:
for (uint8 i = 2; i < StormCount; ++i)
bp0 *= 2;
CellCoord p(acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
CellCoord p(Acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
Cell cell(p);
cell.SetNoCreate();
std::list<Unit*> tempUnitMap;
{
acore::AnyAoETargetUnitInObjectRangeCheck u_check(me, me, SIZE_OF_GRIDS);
acore::UnitListSearcher<acore::AnyAoETargetUnitInObjectRangeCheck> searcher(me, tempUnitMap, u_check);
Acore::AnyAoETargetUnitInObjectRangeCheck u_check(me, me, SIZE_OF_GRIDS);
Acore::UnitListSearcher<Acore::AnyAoETargetUnitInObjectRangeCheck> searcher(me, tempUnitMap, u_check);
TypeContainerVisitor<acore::UnitListSearcher<acore::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
TypeContainerVisitor<acore::UnitListSearcher<acore::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
TypeContainerVisitor<Acore::UnitListSearcher<Acore::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
TypeContainerVisitor<Acore::UnitListSearcher<Acore::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
cell.Visit(p, world_unit_searcher, *me->GetMap(), *me, SIZE_OF_GRIDS);
cell.Visit(p, grid_unit_searcher, *me->GetMap(), *me, SIZE_OF_GRIDS);

View File

@@ -224,14 +224,14 @@ public:
me->GetPosition(x, y, z);
{
CellCoord pair(acore::ComputeCellCoord(x, y));
CellCoord pair(Acore::ComputeCellCoord(x, y));
Cell cell(pair);
cell.SetNoCreate();
acore::AllCreaturesOfEntryInRange check(me, NPC_EGG, 100);
acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange> searcher(me, templist, check);
Acore::AllCreaturesOfEntryInRange check(me, NPC_EGG, 100);
Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange> searcher(me, templist, check);
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
cell.Visit(pair, cSearcher, *me->GetMap(), *me, me->GetGridActivationRange());
}
@@ -257,14 +257,14 @@ public:
me->GetPosition(x, y, z);
{
CellCoord pair(acore::ComputeCellCoord(x, y));
CellCoord pair(Acore::ComputeCellCoord(x, y));
Cell cell(pair);
cell.SetNoCreate();
acore::AllCreaturesOfEntryInRange check(me, NPC_FIRE_BOMB, 100);
acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange> searcher(me, templist, check);
Acore::AllCreaturesOfEntryInRange check(me, NPC_FIRE_BOMB, 100);
Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange> searcher(me, templist, check);
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
cell.Visit(pair, cSearcher, *me->GetMap(), *me, me->GetGridActivationRange());
}
@@ -518,14 +518,14 @@ public:
me->GetPosition(x, y, z);
{
CellCoord pair(acore::ComputeCellCoord(x, y));
CellCoord pair(Acore::ComputeCellCoord(x, y));
Cell cell(pair);
cell.SetNoCreate();
acore::AllCreaturesOfEntryInRange check(me, 23817, 50);
acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange> searcher(me, templist, check);
Acore::AllCreaturesOfEntryInRange check(me, 23817, 50);
Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange> searcher(me, templist, check);
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
cell.Visit(pair, cSearcher, *(me->GetMap()), *me, me->GetGridActivationRange());
}

View File

@@ -141,14 +141,14 @@ public:
me->GetPosition(x, y, z);
{
CellCoord pair(acore::ComputeCellCoord(x, y));
CellCoord pair(Acore::ComputeCellCoord(x, y));
Cell cell(pair);
cell.SetNoCreate();
acore::AllFriendlyCreaturesInGrid check(me);
acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid> searcher(me, templist, check);
Acore::AllFriendlyCreaturesInGrid check(me);
Acore::CreatureListSearcher<Acore::AllFriendlyCreaturesInGrid> searcher(me, templist, check);
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> cSearcher(searcher);
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> cSearcher(searcher);
cell.Visit(pair, cSearcher, *(me->GetMap()), *me, me->GetGridActivationRange());
}
@@ -168,14 +168,14 @@ public:
me->GetPosition(x, y, z);
{
CellCoord pair(acore::ComputeCellCoord(x, y));
CellCoord pair(Acore::ComputeCellCoord(x, y));
Cell cell(pair);
cell.SetNoCreate();
acore::AllFriendlyCreaturesInGrid check(me);
acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid> searcher(me, templist, check);
Acore::AllFriendlyCreaturesInGrid check(me);
Acore::CreatureListSearcher<Acore::AllFriendlyCreaturesInGrid> searcher(me, templist, check);
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> cSearcher(searcher);
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> cSearcher(searcher);
cell.Visit(pair, cSearcher, *(me->GetMap()), *me, me->GetGridActivationRange());
}