city-eval: use public getTrafficDensity() instead of direct access

of trfDensity[] array

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@865 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-09-28 16:34:37 +00:00
parent 2b60d14e96
commit 5252770d10

View file

@ -178,10 +178,11 @@ public class CityEval
int count = 1;
int total = 0;
for (int hy = 0; hy < engine.trfDensity.length; hy++) {
for (int hx = 0; hx < engine.trfDensity[hy].length; hx++) {
if (engine.landValueMem[hy][hx] != 0) {
total += engine.trfDensity[hy][hx];
for (int y = 0; y < engine.getHeight(); y++) {
for (int x = 0; x < engine.getWidth(); x++) {
// only consider tiles that have nonzero landvalue
if (engine.getLandValue(x, y) != 0) {
total += engine.getTrafficDensity(x, y);
count++;
}
}