1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Rename ambiguos 'clear' to 'clearSlots'

A lot of map objects inherit from CCreatureSet and as result - get
clean() method that resets object army
This commit is contained in:
Ivan Savenko
2023-08-07 19:13:02 +03:00
parent f0ede46186
commit e57f8742cd
7 changed files with 13 additions and 13 deletions

View File

@@ -445,7 +445,7 @@ void CCreatureSet::setStackExp(const SlotID & slot, TExpType exp)
stacks[slot]->experience = exp;
}
void CCreatureSet::clear()
void CCreatureSet::clearSlots()
{
while(!stacks.empty())
{
@@ -533,12 +533,12 @@ void CCreatureSet::changeStackCount(const SlotID & slot, TQuantity toAdd)
CCreatureSet::~CCreatureSet()
{
clear();
clearSlots();
}
void CCreatureSet::setToArmy(CSimpleArmy &src)
{
clear();
clearSlots();
while(src)
{
auto i = src.army.begin();
@@ -1050,7 +1050,7 @@ void CStackBasicDescriptor::serializeJson(JsonSerializeFormat & handler)
}
}
void CSimpleArmy::clear()
void CSimpleArmy::clearSlots()
{
army.clear();
}