cleanup: comPlop,indPlop,residentialPlop: use xpos,ypos properties

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@552 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-02-18 01:57:41 +00:00
parent d2066409b9
commit 8572c30c60

View file

@ -1077,7 +1077,7 @@ class MapScanner
if (pop < 5) if (pop < 5)
{ {
comPlop(xpos, ypos, pop, value); comPlop(pop, value);
incrementROG(xpos, ypos, 8); incrementROG(xpos, ypos, 8);
} }
} }
@ -1086,7 +1086,7 @@ class MapScanner
{ {
if (pop < 4) if (pop < 4)
{ {
indPlop(xpos, ypos, pop, value); indPlop(pop, value);
incrementROG(xpos, ypos, 8); incrementROG(xpos, ypos, 8);
} }
} }
@ -1111,7 +1111,7 @@ class MapScanner
if (city.getPopulationDensity(xpos, ypos) > 64) if (city.getPopulationDensity(xpos, ypos) > 64)
{ {
residentialPlop(xpos, ypos, 0, value); residentialPlop(0, value);
incrementROG(xpos, ypos, 8); incrementROG(xpos, ypos, 8);
return; return;
} }
@ -1120,24 +1120,24 @@ class MapScanner
if (pop < 40) if (pop < 40)
{ {
residentialPlop(xpos, ypos, pop / 8 - 1, value); residentialPlop(pop / 8 - 1, value);
incrementROG(xpos, ypos, 8); incrementROG(xpos, ypos, 8);
} }
} }
void comPlop(int xpos, int ypos, int density, int value) void comPlop(int density, int value)
{ {
int base = (value * 5 + density) * 9 + CZB - 4; int base = (value * 5 + density) * 9 + CZB - 4;
zonePlop(xpos, ypos, base); zonePlop(xpos, ypos, base);
} }
void indPlop(int xpos, int ypos, int density, int value) void indPlop(int density, int value)
{ {
int base = (value * 4 + density) * 9 + (IZB - 4); int base = (value * 4 + density) * 9 + (IZB - 4);
zonePlop(xpos, ypos, base); zonePlop(xpos, ypos, base);
} }
void residentialPlop(int xpos, int ypos, int density, int value) void residentialPlop(int density, int value)
{ {
int base = (value * 4 + density) * 9 + RZB - 4; int base = (value * 4 + density) * 9 + RZB - 4;
zonePlop(xpos, ypos, base); zonePlop(xpos, ypos, base);
@ -1147,7 +1147,7 @@ class MapScanner
{ {
if (pop > 1) if (pop > 1)
{ {
comPlop(xpos, ypos, pop-2, value); comPlop(pop-2, value);
incrementROG(xpos, ypos, -8); incrementROG(xpos, ypos, -8);
} }
else if (pop == 1) else if (pop == 1)
@ -1161,7 +1161,7 @@ class MapScanner
{ {
if (pop > 1) if (pop > 1)
{ {
indPlop(xpos, ypos, pop-2, value); indPlop(pop-2, value);
incrementROG(xpos, ypos, -8); incrementROG(xpos, ypos, -8);
} }
else if (pop == 1) else if (pop == 1)
@ -1183,7 +1183,7 @@ class MapScanner
if (pop > 16) if (pop > 16)
{ {
// downgrade to a lower-density full-size residential zone // downgrade to a lower-density full-size residential zone
residentialPlop(xpos, ypos, (pop-24) / 8, value); residentialPlop((pop-24) / 8, value);
incrementROG(xpos, ypos, -8); incrementROG(xpos, ypos, -8);
return; return;
} }