/* * 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; import java.util.ArrayList; /** * * @author jcmtiernan */ public class PlainRobot { private Point robotLocation = new Point(0,10); // initial robot location private int robotIDNumber; //unique ID number private static ArrayList robotIDs = new ArrayList(); public PlainRobot(int robotIDNumber) { this.robotIDNumber = robotIDNumber; // check for unique ID robotIDs.add(this.robotIDNumber); // move to set } public PlainRobot() { // create a unique ID } public PlainRobot(int robotIDNumber, Point loc) { this.robotIDNumber = robotIDNumber; // check for unique ID this.robotLocation = loc; } public Point getRobotLocation() { return robotLocation; } public void setRobotLocation(Point robotLocation) { this.robotLocation = robotLocation; } public int getRobotIDNumber() { return robotIDNumber; } public void setRobotIDNumber(int robotIDNumber) { this.robotIDNumber = robotIDNumber; } @Override public String toString() { return String.format("Robot ID: "+robotIDNumber+"\nLocation: "+robotLocation); } }