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:
parent
41e1321edc
commit
fb2f73c008
1 changed files with 3 additions and 14 deletions
|
@ -19,7 +19,7 @@ class TrafficGen
|
||||||
Micropolis.ZoneType sourceZone;
|
Micropolis.ZoneType sourceZone;
|
||||||
|
|
||||||
int lastdir;
|
int lastdir;
|
||||||
Stack<Position> positions = new Stack<>();
|
Stack<CityLocation> positions = new Stack<>();
|
||||||
|
|
||||||
static final int MAX_TRAFFIC_DISTANCE = 30;
|
static final int MAX_TRAFFIC_DISTANCE = 30;
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ class TrafficGen
|
||||||
{
|
{
|
||||||
while (!positions.isEmpty())
|
while (!positions.isEmpty())
|
||||||
{
|
{
|
||||||
Position pos = positions.pop();
|
CityLocation pos = positions.pop();
|
||||||
mapX = pos.x;
|
mapX = pos.x;
|
||||||
mapY = pos.y;
|
mapY = pos.y;
|
||||||
assert engine.testBounds(mapX, mapY);
|
assert engine.testBounds(mapX, mapY);
|
||||||
|
@ -178,7 +178,7 @@ class TrafficGen
|
||||||
if (z % 2 == 1)
|
if (z % 2 == 1)
|
||||||
{
|
{
|
||||||
// save pos every other move
|
// save pos every other move
|
||||||
positions.push(new Position(mapX, mapY));
|
positions.push(new CityLocation(mapX, mapY));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -188,17 +188,6 @@ class TrafficGen
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class Position
|
|
||||||
{
|
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
Position(int x, int y)
|
|
||||||
{
|
|
||||||
this.x = x;
|
|
||||||
this.y = y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean driveDone()
|
boolean driveDone()
|
||||||
{
|
{
|
||||||
int low, high;
|
int low, high;
|
||||||
|
|
Reference in a new issue