aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Conditions/ConditionMgr.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2015-10-25 10:59:58 +0100
committerShauren <shauren.trinity@gmail.com>2015-10-25 10:59:58 +0100
commit5e0cee85ddd67188365ead3f18206df088e1f0c7 (patch)
treef3981a726305a9c4382c19a6c0820c94e73f7e84 /src/server/game/Conditions/ConditionMgr.cpp
parent52d5de1a7f980193d0d2598f86596cca2dad0de4 (diff)
Core/Conditions: Type renaming
Diffstat (limited to 'src/server/game/Conditions/ConditionMgr.cpp')
-rw-r--r--src/server/game/Conditions/ConditionMgr.cpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index 42511736154..864b989e2b0 100644
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -678,22 +678,22 @@ ConditionMgr::~ConditionMgr()
Clean();
}
-ConditionList ConditionMgr::GetConditionReferences(uint32 refId)
+ConditionContainer ConditionMgr::GetConditionReferences(uint32 refId)
{
- ConditionList conditions;
+ ConditionContainer conditions;
ConditionReferenceContainer::const_iterator ref = ConditionReferenceStore.find(refId);
if (ref != ConditionReferenceStore.end())
conditions = (*ref).second;
return conditions;
}
-uint32 ConditionMgr::GetSearcherTypeMaskForConditionList(ConditionList const& conditions)
+uint32 ConditionMgr::GetSearcherTypeMaskForConditionList(ConditionContainer const& conditions)
{
if (conditions.empty())
return GRID_MAP_TYPE_MASK_ALL;
// groupId, typeMask
std::map<uint32, uint32> ElseGroupStore;
- for (ConditionList::const_iterator i = conditions.begin(); i != conditions.end(); ++i)
+ for (ConditionContainer::const_iterator i = conditions.begin(); i != conditions.end(); ++i)
{
// no point of having not loaded conditions in list
ASSERT((*i)->isLoaded() && "ConditionMgr::GetSearcherTypeMaskForConditionList - not yet loaded condition found in list");
@@ -727,11 +727,11 @@ uint32 ConditionMgr::GetSearcherTypeMaskForConditionList(ConditionList const& co
return mask;
}
-bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo, ConditionList const& conditions)
+bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo, ConditionContainer const& conditions)
{
// groupId, groupCheckPassed
std::map<uint32, bool> ElseGroupStore;
- for (ConditionList::const_iterator i = conditions.begin(); i != conditions.end(); ++i)
+ for (ConditionContainer::const_iterator i = conditions.begin(); i != conditions.end(); ++i)
{
TC_LOG_DEBUG("condition", "ConditionMgr::IsPlayerMeetToConditionList %s val1: %u", (*i)->ToString().c_str(), (*i)->ConditionValue1);
if ((*i)->isLoaded())
@@ -773,19 +773,19 @@ bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo,
return false;
}
-bool ConditionMgr::IsObjectMeetToConditions(WorldObject* object, ConditionList const& conditions)
+bool ConditionMgr::IsObjectMeetToConditions(WorldObject* object, ConditionContainer const& conditions)
{
ConditionSourceInfo srcInfo = ConditionSourceInfo(object);
return IsObjectMeetToConditions(srcInfo, conditions);
}
-bool ConditionMgr::IsObjectMeetToConditions(WorldObject* object1, WorldObject* object2, ConditionList const& conditions)
+bool ConditionMgr::IsObjectMeetToConditions(WorldObject* object1, WorldObject* object2, ConditionContainer const& conditions)
{
ConditionSourceInfo srcInfo = ConditionSourceInfo(object1, object2);
return IsObjectMeetToConditions(srcInfo, conditions);
}
-bool ConditionMgr::IsObjectMeetToConditions(ConditionSourceInfo& sourceInfo, ConditionList const& conditions)
+bool ConditionMgr::IsObjectMeetToConditions(ConditionSourceInfo& sourceInfo, ConditionContainer const& conditions)
{
if (conditions.empty())
return true;
@@ -823,15 +823,15 @@ bool ConditionMgr::CanHaveSourceIdSet(ConditionSourceType sourceType)
return (sourceType == CONDITION_SOURCE_TYPE_SMART_EVENT);
}
-ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType sourceType, uint32 entry)
+ConditionContainer ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType sourceType, uint32 entry)
{
- ConditionList spellCond;
+ ConditionContainer spellCond;
if (sourceType > CONDITION_SOURCE_TYPE_NONE && sourceType < CONDITION_SOURCE_TYPE_MAX)
{
- ConditionContainer::const_iterator itr = ConditionStore.find(sourceType);
+ ConditionEntriesByTypeMap::const_iterator itr = ConditionStore.find(sourceType);
if (itr != ConditionStore.end())
{
- ConditionTypeContainer::const_iterator i = (*itr).second.find(entry);
+ ConditionsByEntryMap::const_iterator i = (*itr).second.find(entry);
if (i != (*itr).second.end())
{
spellCond = (*i).second;
@@ -842,13 +842,13 @@ ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType
return spellCond;
}
-ConditionList ConditionMgr::GetConditionsForSpellClickEvent(uint32 creatureId, uint32 spellId)
+ConditionContainer ConditionMgr::GetConditionsForSpellClickEvent(uint32 creatureId, uint32 spellId)
{
- ConditionList cond;
- CreatureSpellConditionContainer::const_iterator itr = SpellClickEventConditionStore.find(creatureId);
+ ConditionContainer cond;
+ ConditionEntriesByCreatureIdMap::const_iterator itr = SpellClickEventConditionStore.find(creatureId);
if (itr != SpellClickEventConditionStore.end())
{
- ConditionTypeContainer::const_iterator i = (*itr).second.find(spellId);
+ ConditionsByEntryMap::const_iterator i = (*itr).second.find(spellId);
if (i != (*itr).second.end())
{
cond = (*i).second;
@@ -858,13 +858,13 @@ ConditionList ConditionMgr::GetConditionsForSpellClickEvent(uint32 creatureId, u
return cond;
}
-ConditionList ConditionMgr::GetConditionsForVehicleSpell(uint32 creatureId, uint32 spellId)
+ConditionContainer ConditionMgr::GetConditionsForVehicleSpell(uint32 creatureId, uint32 spellId)
{
- ConditionList cond;
- CreatureSpellConditionContainer::const_iterator itr = VehicleSpellConditionStore.find(creatureId);
+ ConditionContainer cond;
+ ConditionEntriesByCreatureIdMap::const_iterator itr = VehicleSpellConditionStore.find(creatureId);
if (itr != VehicleSpellConditionStore.end())
{
- ConditionTypeContainer::const_iterator i = (*itr).second.find(spellId);
+ ConditionsByEntryMap::const_iterator i = (*itr).second.find(spellId);
if (i != (*itr).second.end())
{
cond = (*i).second;
@@ -874,13 +874,13 @@ ConditionList ConditionMgr::GetConditionsForVehicleSpell(uint32 creatureId, uint
return cond;
}
-ConditionList ConditionMgr::GetConditionsForSmartEvent(int64 entryOrGuid, uint32 eventId, uint32 sourceType)
+ConditionContainer ConditionMgr::GetConditionsForSmartEvent(int64 entryOrGuid, uint32 eventId, uint32 sourceType)
{
- ConditionList cond;
+ ConditionContainer cond;
SmartEventConditionContainer::const_iterator itr = SmartEventConditionStore.find(std::make_pair(entryOrGuid, sourceType));
if (itr != SmartEventConditionStore.end())
{
- ConditionTypeContainer::const_iterator i = (*itr).second.find(eventId + 1);
+ ConditionsByEntryMap::const_iterator i = (*itr).second.find(eventId + 1);
if (i != (*itr).second.end())
{
cond = (*i).second;
@@ -890,13 +890,13 @@ ConditionList ConditionMgr::GetConditionsForSmartEvent(int64 entryOrGuid, uint32
return cond;
}
-ConditionList ConditionMgr::GetConditionsForNpcVendorEvent(uint32 creatureId, uint32 itemId)
+ConditionContainer ConditionMgr::GetConditionsForNpcVendorEvent(uint32 creatureId, uint32 itemId)
{
- ConditionList cond;
- NpcVendorConditionContainer::const_iterator itr = NpcVendorConditionContainerStore.find(creatureId);
+ ConditionContainer cond;
+ ConditionEntriesByCreatureIdMap::const_iterator itr = NpcVendorConditionContainerStore.find(creatureId);
if (itr != NpcVendorConditionContainerStore.end())
{
- ConditionTypeContainer::const_iterator i = (*itr).second.find(itemId);
+ ConditionsByEntryMap::const_iterator i = (*itr).second.find(itemId);
if (i != (*itr).second.end())
{
cond = (*i).second;
@@ -1026,7 +1026,7 @@ void ConditionMgr::LoadConditions(bool isReload)
uint32 uRefId = abs(iSourceTypeOrReferenceId);
if (ConditionReferenceStore.find(uRefId) == ConditionReferenceStore.end())//make sure we have a list for our conditions, based on reference id
{
- ConditionList mCondList;
+ ConditionContainer mCondList;
ConditionReferenceStore[uRefId] = mCondList;
}
ConditionReferenceStore[uRefId].push_back(cond);//add to reference storage
@@ -1183,14 +1183,14 @@ void ConditionMgr::LoadConditions(bool isReload)
//make sure we have a storage list for our SourceType
if (ConditionStore.find(cond->SourceType) == ConditionStore.end())
{
- ConditionTypeContainer mTypeMap;
+ ConditionsByEntryMap mTypeMap;
ConditionStore[cond->SourceType] = mTypeMap;//add new empty list for SourceType
}
//make sure we have a condition list for our SourceType's entry
if (ConditionStore[cond->SourceType].find(cond->SourceEntry) == ConditionStore[cond->SourceType].end())
{
- ConditionList mCondList;
+ ConditionContainer mCondList;
ConditionStore[cond->SourceType][cond->SourceEntry] = mCondList;
}
@@ -1284,7 +1284,7 @@ bool ConditionMgr::addToSpellImplicitTargetConditions(Condition* cond)
// build new shared mask with found effect
uint32 sharedMask = 1 << i;
- ConditionList* cmp = effect->ImplicitTargetConditions;
+ ConditionContainer* cmp = effect->ImplicitTargetConditions;
for (uint8 effIndex = i + 1; effIndex < MAX_SPELL_EFFECTS; ++effIndex)
{
SpellEffectInfo const* inner = spellInfo->GetEffect(DIFFICULTY_NONE, effIndex);
@@ -1316,7 +1316,7 @@ bool ConditionMgr::addToSpellImplicitTargetConditions(Condition* cond)
continue;
// get shared data
- ConditionList* sharedList = effect->ImplicitTargetConditions;
+ ConditionContainer* sharedList = effect->ImplicitTargetConditions;
// there's already data entry for that sharedMask
if (sharedList)
@@ -1333,7 +1333,7 @@ bool ConditionMgr::addToSpellImplicitTargetConditions(Condition* cond)
else
{
// add new list, create new shared mask
- sharedList = new ConditionList();
+ sharedList = new ConditionContainer();
bool assigned = false;
for (uint8 i = firstEffIndex; i < MAX_SPELL_EFFECTS; ++i)
{
@@ -2254,18 +2254,18 @@ void ConditionMgr::Clean()
{
for (ConditionReferenceContainer::iterator itr = ConditionReferenceStore.begin(); itr != ConditionReferenceStore.end(); ++itr)
{
- for (ConditionList::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it)
+ for (ConditionContainer::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it)
delete *it;
itr->second.clear();
}
ConditionReferenceStore.clear();
- for (ConditionContainer::iterator itr = ConditionStore.begin(); itr != ConditionStore.end(); ++itr)
+ for (ConditionEntriesByTypeMap::iterator itr = ConditionStore.begin(); itr != ConditionStore.end(); ++itr)
{
- for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
+ for (ConditionsByEntryMap::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
{
- for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
+ for (ConditionContainer::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
delete *i;
it->second.clear();
}
@@ -2274,11 +2274,11 @@ void ConditionMgr::Clean()
ConditionStore.clear();
- for (CreatureSpellConditionContainer::iterator itr = VehicleSpellConditionStore.begin(); itr != VehicleSpellConditionStore.end(); ++itr)
+ for (ConditionEntriesByCreatureIdMap::iterator itr = VehicleSpellConditionStore.begin(); itr != VehicleSpellConditionStore.end(); ++itr)
{
- for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
+ for (ConditionsByEntryMap::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
{
- for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
+ for (ConditionContainer::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
delete *i;
it->second.clear();
}
@@ -2289,9 +2289,9 @@ void ConditionMgr::Clean()
for (SmartEventConditionContainer::iterator itr = SmartEventConditionStore.begin(); itr != SmartEventConditionStore.end(); ++itr)
{
- for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
+ for (ConditionsByEntryMap::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
{
- for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
+ for (ConditionContainer::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
delete *i;
it->second.clear();
}
@@ -2300,11 +2300,11 @@ void ConditionMgr::Clean()
SmartEventConditionStore.clear();
- for (CreatureSpellConditionContainer::iterator itr = SpellClickEventConditionStore.begin(); itr != SpellClickEventConditionStore.end(); ++itr)
+ for (ConditionEntriesByCreatureIdMap::iterator itr = SpellClickEventConditionStore.begin(); itr != SpellClickEventConditionStore.end(); ++itr)
{
- for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
+ for (ConditionsByEntryMap::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
{
- for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
+ for (ConditionContainer::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
delete *i;
it->second.clear();
}
@@ -2313,11 +2313,11 @@ void ConditionMgr::Clean()
SpellClickEventConditionStore.clear();
- for (NpcVendorConditionContainer::iterator itr = NpcVendorConditionContainerStore.begin(); itr != NpcVendorConditionContainerStore.end(); ++itr)
+ for (ConditionEntriesByCreatureIdMap::iterator itr = NpcVendorConditionContainerStore.begin(); itr != NpcVendorConditionContainerStore.end(); ++itr)
{
- for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
+ for (ConditionsByEntryMap::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
{
- for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
+ for (ConditionContainer::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
delete *i;
it->second.clear();
}