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:
parent
2b60d14e96
commit
5252770d10
1 changed files with 5 additions and 4 deletions
|
@ -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++;
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue