refactor: make accessor method for fireRate[] array
git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@873 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
parent
e7cb33ca92
commit
93381a3490
2 changed files with 7 additions and 1 deletions
|
@ -1059,6 +1059,12 @@ public class Micropolis
|
||||||
trfDensity[mapY/2][mapX/2] = z;
|
trfDensity[mapY/2][mapX/2] = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Accessor method for fireRate[]. */
|
||||||
|
public int getFireStationCoverage(int xpos, int ypos)
|
||||||
|
{
|
||||||
|
return fireRate[ypos/8][xpos/8];
|
||||||
|
}
|
||||||
|
|
||||||
/** Accessor method for landValueMem overlay. */
|
/** Accessor method for landValueMem overlay. */
|
||||||
public int getLandValue(int xpos, int ypos)
|
public int getLandValue(int xpos, int ypos)
|
||||||
{
|
{
|
||||||
|
|
|
@ -91,7 +91,7 @@ class TerrainBehavior extends TileBehavior
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int cov = city.fireRate[ypos/8][xpos/8]; //fire station coverage
|
int cov = city.getFireStationCoverage(xpos, ypos);
|
||||||
int rate = cov > 100 ? 1 :
|
int rate = cov > 100 ? 1 :
|
||||||
cov > 20 ? 2 :
|
cov > 20 ? 2 :
|
||||||
cov != 0 ? 3 : 10;
|
cov != 0 ? 3 : 10;
|
||||||
|
|
Reference in a new issue