mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-03 13:01:33 +02:00
Replace more magic subIDs with readable enums
This commit is contained in:
parent
6ff0c5d58d
commit
f6df107a55
@ -618,16 +618,16 @@ void CGTownInstance::initObj(CRandomGenerator & rand)
|
|||||||
|
|
||||||
switch (subID)
|
switch (subID)
|
||||||
{ //add new visitable objects
|
{ //add new visitable objects
|
||||||
case 0:
|
case ETownType::CASTLE:
|
||||||
bonusingBuildings.push_back (new COPWBonus(BuildingID::STABLES, this));
|
bonusingBuildings.push_back (new COPWBonus(BuildingID::STABLES, this));
|
||||||
break;
|
break;
|
||||||
case 5:
|
case ETownType::DUNGEON:
|
||||||
bonusingBuildings.push_back (new COPWBonus(BuildingID::MANA_VORTEX, this));
|
bonusingBuildings.push_back (new COPWBonus(BuildingID::MANA_VORTEX, this));
|
||||||
//fallthrough
|
//fallthrough
|
||||||
case 2: case 3: case 6:
|
case ETownType::TOWER: case ETownType::INFERNO: case ETownType::STRONGHOLD:
|
||||||
bonusingBuildings.push_back (new CTownBonus(BuildingID::SPECIAL_4, this));
|
bonusingBuildings.push_back (new CTownBonus(BuildingID::SPECIAL_4, this));
|
||||||
break;
|
break;
|
||||||
case 7:
|
case ETownType::FORTRESS:
|
||||||
bonusingBuildings.push_back (new CTownBonus(BuildingID::SPECIAL_1, this));
|
bonusingBuildings.push_back (new CTownBonus(BuildingID::SPECIAL_1, this));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -867,10 +867,10 @@ void CGResource::initObj(CRandomGenerator & rand)
|
|||||||
{
|
{
|
||||||
switch(subID)
|
switch(subID)
|
||||||
{
|
{
|
||||||
case 6:
|
case Res::GOLD:
|
||||||
amount = rand.nextInt(5, 10) * 100;
|
amount = rand.nextInt(5, 10) * 100;
|
||||||
break;
|
break;
|
||||||
case 0: case 2:
|
case Res::WOOD: case Res::ORE:
|
||||||
amount = rand.nextInt(6, 10);
|
amount = rand.nextInt(6, 10);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user