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()
|
void doZone()
|
||||||
{
|
{
|
||||||
// set power bit in map, from powermap
|
// set power bit in map, from powermap
|
||||||
boolean zonePwrFlag = setZonePower();
|
boolean zonePwrFlag = checkZonePower();
|
||||||
|
|
||||||
if (zonePwrFlag)
|
|
||||||
{
|
|
||||||
city.poweredZoneCount++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
city.unpoweredZoneCount++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isSpecialZone(cchr))
|
if (isSpecialZone(cchr))
|
||||||
{
|
{
|
||||||
|
@ -455,6 +446,22 @@ class MapScanner
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean checkZonePower()
|
||||||
|
{
|
||||||
|
boolean zonePwrFlag = setZonePower();
|
||||||
|
|
||||||
|
if (zonePwrFlag)
|
||||||
|
{
|
||||||
|
city.poweredZoneCount++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
city.unpoweredZoneCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return zonePwrFlag;
|
||||||
|
}
|
||||||
|
|
||||||
boolean setZonePower()
|
boolean setZonePower()
|
||||||
{
|
{
|
||||||
// refresh cchr, cchr9, since this can get called after the
|
// refresh cchr, cchr9, since this can get called after the
|
||||||
|
|
Reference in a new issue