refactor: checkZonePower() to set PWR bit and count zones
git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@829 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
parent
07bc48c34c
commit
0f2c2f4617
1 changed files with 17 additions and 10 deletions
|
@ -415,16 +415,7 @@ class MapScanner
|
|||
void doZone()
|
||||
{
|
||||
// set power bit in map, from powermap
|
||||
boolean zonePwrFlag = setZonePower();
|
||||
|
||||
if (zonePwrFlag)
|
||||
{
|
||||
city.poweredZoneCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
city.unpoweredZoneCount++;
|
||||
}
|
||||
boolean zonePwrFlag = checkZonePower();
|
||||
|
||||
if (isSpecialZone(cchr))
|
||||
{
|
||||
|
@ -455,6 +446,22 @@ class MapScanner
|
|||
return;
|
||||
}
|
||||
|
||||
boolean checkZonePower()
|
||||
{
|
||||
boolean zonePwrFlag = setZonePower();
|
||||
|
||||
if (zonePwrFlag)
|
||||
{
|
||||
city.poweredZoneCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
city.unpoweredZoneCount++;
|
||||
}
|
||||
|
||||
return zonePwrFlag;
|
||||
}
|
||||
|
||||
boolean setZonePower()
|
||||
{
|
||||
// refresh cchr, cchr9, since this can get called after the
|
||||
|
|
Reference in a new issue