doSpecialZone: use annotations to control which special zone processing is done

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@836 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-09-03 01:07:35 +00:00
parent 18f00153a3
commit db6f3fb59c
2 changed files with 39 additions and 56 deletions

View file

@ -45,7 +45,14 @@ class MapScanner
HOSPITAL_CHURCH,
COMMERCIAL,
INDUSTRIAL,
SPECIAL;
COAL,
NUCLEAR,
FIRESTATION,
POLICESTATION,
STADIUM_EMPTY,
STADIUM_FULL,
AIRPORT,
SEAPORT;
}
/**
@ -92,8 +99,29 @@ class MapScanner
case INDUSTRIAL:
doIndustrial();
return;
case SPECIAL:
doSpecialZone();
case COAL:
doCoalPower();
return;
case NUCLEAR:
doNuclearPower();
return;
case FIRESTATION:
doFireStation();
return;
case POLICESTATION:
doPoliceStation();
return;
case STADIUM_EMPTY:
doStadiumEmpty();
return;
case STADIUM_FULL:
doStadiumFull();
return;
case AIRPORT:
doAirport();
return;
case SEAPORT:
doSeaport();
return;
default:
throw new Error("Unknown behavior: "+behaviorStr);
@ -639,51 +667,6 @@ class MapScanner
}
}
/**
* Called when the current tile is the key tile of a "special" zone.
*/
void doSpecialZone()
{
switch (cchr9)
{
case POWERPLANT:
doCoalPower();
return;
case NUCLEAR:
doNuclearPower();
return;
case FIRESTATION:
doFireStation();
return;
case POLICESTATION:
doPoliceStation();
return;
case STADIUM:
doStadiumEmpty();
return;
case FULLSTADIUM:
doStadiumFull();
return;
case AIRPORT:
doAirport();
return;
case PORT:
doSeaport();
return;
default:
// should not happen
assert false;
}
}
/**
* Place hospital or church if needed.
*/