removed calls to ManaCost::init() as all but two are actually necessary.
moved init() from ManaCost to a private call changed ManaPool method init() to Empty() to better represent what it does. renamed ManaCost::reinit to resetCosts() as reinit sounds like your are returning the ManaCost object back to initial state which is not what happens. Only the cost related members are reset, the bool isMulti is left alone
This commit is contained in:
@@ -388,11 +388,14 @@ int ManaCost::hasAnotherCost()
|
||||
void ManaCost::init()
|
||||
{
|
||||
int i;
|
||||
cost.erase(cost.begin(),cost.end());
|
||||
|
||||
cost.erase(cost.begin() ,cost.end());
|
||||
|
||||
for (i = 0; i <= Constants::NB_Colors; i++)
|
||||
{
|
||||
cost.push_back(0);
|
||||
}
|
||||
|
||||
extraCosts = NULL;
|
||||
kicker = NULL;
|
||||
alternative = NULL;
|
||||
@@ -404,7 +407,7 @@ void ManaCost::init()
|
||||
isMulti = false;
|
||||
}
|
||||
|
||||
void ManaCost::reinit()
|
||||
void ManaCost::resetCosts()
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -414,6 +417,7 @@ void ManaCost::reinit()
|
||||
{
|
||||
cost.push_back(0);
|
||||
}
|
||||
|
||||
SAFE_DELETE(extraCosts);
|
||||
SAFE_DELETE(kicker);
|
||||
SAFE_DELETE(alternative);
|
||||
@@ -841,9 +845,9 @@ ostream& operator<<(ostream& out, ManaCost m)
|
||||
return out << m.toString();
|
||||
}
|
||||
|
||||
void ManaPool::init()
|
||||
void ManaPool::Empty()
|
||||
{
|
||||
ManaCost::init();
|
||||
init();
|
||||
WEvent * e = NEW WEventEmptyManaPool(this);
|
||||
player->getObserver()->receiveEvent(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user