From fb2f73c008a90e7b586860a66662513d95c6cef9 Mon Sep 17 00:00:00 2001 From: "jason@long.name" Date: Wed, 20 Feb 2013 01:36:36 +0000 Subject: [PATCH] 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 --- src/micropolisj/engine/TrafficGen.java | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/micropolisj/engine/TrafficGen.java b/src/micropolisj/engine/TrafficGen.java index 48f0df4..a320774 100644 --- a/src/micropolisj/engine/TrafficGen.java +++ b/src/micropolisj/engine/TrafficGen.java @@ -19,7 +19,7 @@ class TrafficGen Micropolis.ZoneType sourceZone; int lastdir; - Stack positions = new Stack<>(); + Stack 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;