Grundstruktur überabreitet + RobotFactory und Enum angelegt

Aufsteigende_Sortierung
cedri 2022-12-31 14:06:15 +01:00
parent 21b488f66f
commit dc5a7aea2b
6 changed files with 46 additions and 13 deletions

View File

@ -0,0 +1,13 @@
package domain;
import roboterSystem.Robot;
public class C3PO implements Robot {
public C3PO(String name) {
// TODO Auto-generated constructor stub
}
}

View File

@ -0,0 +1,12 @@
package domain;
import roboterSystem.Robot;
public class R2D2 implements Robot {
public R2D2(String name) {
// TODO Auto-generated constructor stub
}
}

View File

@ -0,0 +1,16 @@
package domain;
import roboterSystem.Robot;
public class RobotFactory {
public static Robot RobotFactory (String modell, String name) {
switch(modell) {
case "C3PO":
return new C3PO(name);
case "R2D2":
return new R2D2(name);
}
}
}

View File

@ -0,0 +1,5 @@
package domain;
public enum RobotType {
C3PO, R2D2;
}

View File

@ -1,7 +0,0 @@
package roboterSystem;
public class C3PO implements Robot {
}

View File

@ -1,6 +0,0 @@
package roboterSystem;
public class R2D2 implements Robot {
}