public class Robot { public Robot(double x, double y) { x = 0.0; y = 0.0; } public double getX() { return X; } public double getY() { return Y; } public double getHeading() { int h = 0; if (h >= 0 && h < 360) return h; return h; } public double getBatteryCapacity() { if (BCW <= 1.0) return 1.0 - BCW; else return 1.0; } public double readBatteryMeter() { return readBatteryMeter(); } public double distance() { if (distanceTravelled <= 0) return 0; return distanceTravelled; } public void turnRight() { if (MPW + X == distanceTravelled*turnRight) return; } public void turnLeft() { if (MPW + X == distanceTravelled*turnLeft) return; } public void recharge(double seconds) { wattsAvailable += SPW*MPW; } public double goForward(double distance) { if (MPW + X == distanceTravelled*goForward) return distanceTravelled*goForward; else return 0; } private double wattsAvailable; private double X; private double Y; private double distanceTravelled; private double goForward; private double turnLeft; private double turnRight; private static final double MPW = 10.0; private static final double SPW = 2.0; private static final double BCW = 1.0; }
I need an opinion on this code cause I just made it and I want it to work with another code.