diff options
author | Peter Wu <lekensteyn@gmail.com> | 2014-01-16 19:53:17 +0100 |
---|---|---|
committer | Peter Wu <lekensteyn@gmail.com> | 2014-01-16 19:53:17 +0100 |
commit | 19497b579424ac8130c0fb3bc754e04937cb714b (patch) | |
tree | b687c3ec39e9782b7d56c85c2be0898b031bf945 | |
parent | a14efbaf74ad6a21d5dceecf742b41c5fb4939d1 (diff) | |
download | 2iv60-robots-19497b579424ac8130c0fb3bc754e04937cb714b.tar.gz |
Remove duplicate functionality
-rw-r--r-- | src/Camera.java | 17 | ||||
-rw-r--r-- | src/Robot.java | 7 |
2 files changed, 2 insertions, 22 deletions
diff --git a/src/Camera.java b/src/Camera.java index c1b220b..8bc07a6 100644 --- a/src/Camera.java +++ b/src/Camera.java @@ -162,7 +162,7 @@ class Camera { /** * First person mode: look from the slowest robot forward. */ - FocusPosition focus = smoothFocusTo(getLastRobot()); + FocusPosition focus = smoothFocusTo(getSlowestRobot()); // trivial: looks from the robot POV. eye = track.getPointForLane(focus.getTimePos(), focus.getLane()); @@ -225,6 +225,7 @@ class Camera { /** * Returns the robots which has the lowest Global State Time position. + * (i.e. the last robot on the field). */ private Robot getSlowestRobot() { Robot slowest = robots[0]; @@ -235,20 +236,6 @@ class Camera { } return slowest; } - - /** - * Returns the robot which is placed last in the race. - */ - private Robot getLastRobot() { - Robot last = robots[0]; - - for (Robot robot : robots) { - if (robot.getPositionMeters() < last.getPositionMeters()) { - last = robot; - } - } - return last; - } /** * Time when the transition started; diff --git a/src/Robot.java b/src/Robot.java index 36a6f6e..612ecec 100644 --- a/src/Robot.java +++ b/src/Robot.java @@ -546,13 +546,6 @@ class Robot extends BetterBase { public double getSpeed() { return speed; } - - /** - * Gets the total distance traveled by the robot. - */ - public double getPositionMeters() { - return robot_pos_meters; - } /** * Move the robot with the number of seconds based on its current speed. |