cleanup: coalSmoke: use xpos,ypos properties instead of function arguments

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@556 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-02-18 01:58:08 +00:00
parent 8e9902ef64
commit c48abf0bca

View file

@ -533,7 +533,7 @@ class MapScanner
}
city.powerPlants.add(new CityLocation(xpos,ypos));
coalSmoke(xpos, ypos);
coalSmoke();
return;
case NUCLEAR:
@ -820,7 +820,11 @@ class MapScanner
}
/*
* Add smoke to an industrial zone.
* Animate tiles in an industrial zone.
* Note: pollution is not accumulated here; it is instead
* accumulated in ptlScan(), by adding up each tile's
* pollution value.
*
* @param powerOn indicates whether the building has power
*/
void setSmoke(boolean powerOn)
@ -1321,14 +1325,19 @@ class MapScanner
return 3;
}
void coalSmoke(int mx, int my)
/**
* Process the coal powerplant animation.
* Note: pollution is not accumulated here; see ptlScan()
* instead.
*/
void coalSmoke()
{
final int [] SmTb = { COALSMOKE1, COALSMOKE2, COALSMOKE3, COALSMOKE4 };
final int [] dx = { 1, 2, 1, 2 };
final int [] dy = { -1, -1, 0, 0 };
for (int z = 0; z < 4; z++) {
city.setTile(mx + dx[z], my + dy[z],
city.setTile(xpos + dx[z], ypos + dy[z],
(char) (SmTb[z] | ANIMBIT | CONDBIT | PWRBIT | BURNBIT)
);
}