package domain; import robot.exceptions.RobotException; import robot.exceptions.RobotIllegalStateException; public class R2D2 extends RobotBasics { /** * Constructor @@ -8,7 +12,35 @@ public class R2D2 extends RobotBasics { */ public R2D2(int id, String name){ super(id, name); } @Override public int[] think(int[] zahlen) throws RobotException { if(isPowerOn()){ return sorting(zahlen); }else{ throw new RobotIllegalStateException(getName() + " is turned off!"); } } public int[] sorting(int[] arr) { //Selectionsort int small; for (int i = 0; i