/* * 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 { private int maxSizeInInches = 18; private double maxCostInDollars = 300.0; public SmallRobot(int robotIDNumber) { super(robotIDNumber); } 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 String toString() { return String.format(super.toString()+"\nMaximum Size: "+maxSizeInInches); } }