cleanup: eliminate TrafficGen.Position in favor of CityLocation

Two classes that did the same thing for the same purpose.

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@562 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-02-20 01:36:36 +00:00
parent 41e1321edc
commit fb2f73c008

View file

@ -19,7 +19,7 @@ class TrafficGen
Micropolis.ZoneType sourceZone;
int lastdir;
Stack<Position> positions = new Stack<>();
Stack<CityLocation> positions = new Stack<>();
static final int MAX_TRAFFIC_DISTANCE = 30;
@ -52,7 +52,7 @@ class TrafficGen
{
while (!positions.isEmpty())
{
Position pos = positions.pop();
CityLocation pos = positions.pop();
mapX = pos.x;
mapY = pos.y;
assert engine.testBounds(mapX, mapY);
@ -178,7 +178,7 @@ class TrafficGen
if (z % 2 == 1)
{
// save pos every other move
positions.push(new Position(mapX, mapY));
positions.push(new CityLocation(mapX, mapY));
}
return true;
@ -188,17 +188,6 @@ class TrafficGen
return false;
}
static class Position
{
int x;
int y;
Position(int x, int y)
{
this.x = x;
this.y = y;
}
}
boolean driveDone()
{
int low, high;