/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package pointtest; /** * * @author jcmtiernan */ public class SmallRobot extends PlainRobot implements MovingThang { private int maxSizeInInches = 18; private double maxCostInDollars = 300.0; private double maxSpeedInFeetPerSecond = 0.0; public SmallRobot(int robotIDNumber) { super(robotIDNumber); } public SmallRobot() { } public SmallRobot(int robotIDNumber, Point loc) { super(robotIDNumber, loc); } public SmallRobot(int robotIDNumber, Point loc, int size, double cost) { super(robotIDNumber, loc); setMaxSizeInInches(size); setMaxCostInDollars(cost); } public int getMaxSizeInInches() { return maxSizeInInches; } public void setMaxSizeInInches(int maxSizeInInches) { if ((maxSizeInInches > 0) && (maxSizeInInches <= 18)) { this.maxSizeInInches = maxSizeInInches; } } public double getMaxCostInDollars() { return maxCostInDollars; } public void setMaxCostInDollars(double maxCostInDollars) { if ((maxCostInDollars > 0.0)&& (maxCostInDollars <= 300.0)) { this.maxCostInDollars = maxCostInDollars; } } @Override public double getMaxSpeed() { return this.maxSpeedInFeetPerSecond; } @Override public void setMaxSpeed(double maxSpeed) { if (maxSpeed < 0) { this.maxSpeedInFeetPerSecond = -maxSpeed; } else if (maxSpeed > 5) { this.maxSpeedInFeetPerSecond = 5; } else { this.maxSpeedInFeetPerSecond = maxSpeed; } } public LOCOMOTION getKindOfLoco() ; public void setKindOfLoco(LOCOMOTION kindOfLoco) ; public void setKindOfLoco(String nameOfLoco); @Override public String toString() { return String.format(super.toString()+"\nMaximum Size: "+maxSizeInInches); } }