diff --git a/Roboterfabrik/src/Domäne/Nexus6.java b/Roboterfabrik/src/Domäne/Nexus6.java new file mode 100644 index 0000000..79020f1 --- /dev/null +++ b/Roboterfabrik/src/Domäne/Nexus6.java @@ -0,0 +1,47 @@ +package Domäne; + +import Exception.RobotException; +import Exception.RobotIllegalStateException; + +public class Nexus6 extends Roboter { + + String name; + int id; + private static Nexus6 pris; + + + private Nexus6() { + super("Pris"); + this.id = 19_281_982; + + + } + + + + public static Nexus6 getInstance () { + if (pris == null) { + pris = new Nexus6(); + } + return pris; + } + + @Override + public void triggerPowerSwitch() { + power = false; + } + + + @Override + public int getId() { + return id; + } + + @Override + public int[] think(int[] zahlen)throws RobotException { + + + return null; + } + +} diff --git a/Roboterfabrik/src/Domäne/RobotFactory.java b/Roboterfabrik/src/Domäne/RobotFactory.java index b311fc9..5129745 100644 --- a/Roboterfabrik/src/Domäne/RobotFactory.java +++ b/Roboterfabrik/src/Domäne/RobotFactory.java @@ -10,7 +10,7 @@ public RobotFactory (String name) { this.name = name; } - public int addRoboter (RobotType robotType) { + public int addRobot (RobotType robotType) { Roboter roboter; if (RobotType.R2D2 == robotType) { @@ -27,4 +27,12 @@ public RobotFactory (String name) { else return -1; } + + public String getName() { + return name; + } + + public Roboter findeRoboter (int id) { + return roboters.get(id); + } }