From 19497b579424ac8130c0fb3bc754e04937cb714b Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Thu, 16 Jan 2014 19:53:17 +0100 Subject: Remove duplicate functionality --- src/Camera.java | 17 ++--------------- 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. -- cgit v1.2.1