From 26b65fab46795bc39d531cd3632900e1ce334de0 Mon Sep 17 00:00:00 2001 From: Philipp3107 Date: Fri, 6 Jan 2023 22:55:33 +0100 Subject: [PATCH] updated packages --- Main.java | 2 - domain/C3PO.java | 35 ++++++++++-- domain/C3POTest.java | 2 +- domain/Factory.java | 6 ++- domain/R2D2.java | 42 ++++++++++++--- domain/Robot.java | 51 +----------------- facade/FactorySystem.java | 14 ++++- infrastructure/Persistenz.java | 7 +-- out/production/Robot_Factory_PR/Main.class | Bin 574 -> 574 bytes out/production/Robot_Factory_PR/README.md | 24 +++++---- .../Robot_Factory_PR/domain/C3PO.class | Bin 1640 -> 1984 bytes .../Robot_Factory_PR/domain/C3POTest.class | Bin 3580 -> 3582 bytes .../Robot_Factory_PR/domain/Factory.class | Bin 1308 -> 1488 bytes .../Robot_Factory_PR/domain/R2D2.class | Bin 1414 -> 1823 bytes .../Robot_Factory_PR/domain/Robot.class | Bin 4316 -> 3729 bytes .../facade/FactorySystem.class | Bin 2070 -> 2349 bytes .../infrastructure/Persistenz.class | Bin 1916 -> 1877 bytes .../safety/interfaces/Robot.class | Bin 190 -> 0 bytes .../safety/interfaces/RobotControl.class | Bin 319 -> 0 bytes .../safety/interfaces/RobotInstructions.class | Bin 276 -> 0 bytes .../ArrayEmptyException.class | Bin 524 -> 0 bytes .../robot_exceptions/ExceptionStorage.class | Bin 1067 -> 0 bytes .../RobotIllegalStateException.class | Bin 545 -> 0 bytes .../RobotMagicValueException.class | Bin 539 -> 0 bytes .../Robot_Factory_PR/test_factoryFactory.ser | Bin 434 -> 497 bytes out/production/Robot_Factory_PR/ui/UI.class | Bin 3459 -> 3981 bytes .../utility/interfaces/Robot.class | Bin 0 -> 193 bytes .../utility/interfaces/RobotControl.class | Bin 0 -> 321 bytes .../interfaces/RobotInstructions.class | Bin 0 -> 278 bytes .../ArrayEmptyException.class | Bin 0 -> 529 bytes .../robot_exceptions/ExceptionStorage.class | Bin 0 -> 1100 bytes .../robot_exceptions/RobotException.class | Bin 1391 -> 1397 bytes .../RobotIllegalStateException.class | Bin 0 -> 550 bytes .../RobotMagicValueException.class | Bin 0 -> 544 bytes .../robot_exceptions/robotExceptions.class | Bin 1480 -> 1486 bytes test_factoryFactory.ser | Bin 471 -> 497 bytes ui/UI.java | 29 +++++++--- utility/interfaces/Robot.java | 2 +- utility/interfaces/RobotControl.java | 4 +- utility/interfaces/RobotInstructions.java | 8 +-- .../robot_exceptions/ArrayEmptyException.java | 2 +- .../robot_exceptions/ExceptionStorage.java | 5 +- utility/robot_exceptions/RobotException.java | 2 +- .../RobotIllegalStateException.java | 2 +- .../RobotMagicValueException.java | 2 +- utility/robot_exceptions/robotExceptions.java | 2 +- 46 files changed, 139 insertions(+), 102 deletions(-) delete mode 100644 out/production/Robot_Factory_PR/safety/interfaces/Robot.class delete mode 100644 out/production/Robot_Factory_PR/safety/interfaces/RobotControl.class delete mode 100644 out/production/Robot_Factory_PR/safety/interfaces/RobotInstructions.class delete mode 100644 out/production/Robot_Factory_PR/safety/robot_exceptions/ArrayEmptyException.class delete mode 100644 out/production/Robot_Factory_PR/safety/robot_exceptions/ExceptionStorage.class delete mode 100644 out/production/Robot_Factory_PR/safety/robot_exceptions/RobotIllegalStateException.class delete mode 100644 out/production/Robot_Factory_PR/safety/robot_exceptions/RobotMagicValueException.class create mode 100644 out/production/Robot_Factory_PR/utility/interfaces/Robot.class create mode 100644 out/production/Robot_Factory_PR/utility/interfaces/RobotControl.class create mode 100644 out/production/Robot_Factory_PR/utility/interfaces/RobotInstructions.class create mode 100644 out/production/Robot_Factory_PR/utility/robot_exceptions/ArrayEmptyException.class create mode 100644 out/production/Robot_Factory_PR/utility/robot_exceptions/ExceptionStorage.class rename out/production/Robot_Factory_PR/{safety => utility}/robot_exceptions/RobotException.class (54%) create mode 100644 out/production/Robot_Factory_PR/utility/robot_exceptions/RobotIllegalStateException.class create mode 100644 out/production/Robot_Factory_PR/utility/robot_exceptions/RobotMagicValueException.class rename out/production/Robot_Factory_PR/{safety => utility}/robot_exceptions/robotExceptions.class (57%) diff --git a/Main.java b/Main.java index 7b9e807..e5f8633 100644 --- a/Main.java +++ b/Main.java @@ -1,6 +1,4 @@ -import domain.*; import facade.FactorySystem; -import safety.robot_exceptions.RobotException; import ui.UI; public class Main { diff --git a/domain/C3PO.java b/domain/C3PO.java index 90f49e0..b25c0ea 100644 --- a/domain/C3PO.java +++ b/domain/C3PO.java @@ -1,8 +1,8 @@ package domain; -import safety.robot_exceptions.ExceptionStorage; -import safety.robot_exceptions.RobotException; -import safety.robot_exceptions.robotExceptions; +import utility.robot_exceptions.ExceptionStorage; +import utility.robot_exceptions.RobotException; +import utility.robot_exceptions.robotExceptions; public class C3PO extends Robot { public C3PO(int id, String name){ @@ -44,14 +44,39 @@ public class C3PO extends Robot { //throw new RobotMagicValueException(getName() + " has an unknown error. Code 42"); } } + + /** + * Sorts any given array of integers with the insertion Sort algorithm. + * @param input int [ ] + * @return input int [ ] (sorted) + * @throws RobotException + */ + public int[] insertionSort(int[] input) throws RobotException { + if (checkArray(input)) { + for (int i = 1; i < input.length; i++) { + int b = i - 1; + int key = input[i]; + while (b >= 0 && input[b] > key) input[b + 1] = input[b--]; + input[b + 1] = key; + } + return input; + }else{ + RobotException robotexception = new RobotException(robotExceptions.MAGICVALUE, getName()); + this.exceptions = new ExceptionStorage(robotexception); + throw robotexception; + } + + } + @Override public int[] think(int[] input) throws RobotException { //Insertionsort if(isPowerOn()){ return sorting(input); }else{ - throw new RobotException(robotExceptions.ILLEGALSTATE, getName()); - // throw new RobotIllegalStateException(getName() + " is turned off."); + RobotException robotException = new RobotException(robotExceptions.ILLEGALSTATE, getName()); + this.exceptions = new ExceptionStorage(robotException); + throw robotException; } } } diff --git a/domain/C3POTest.java b/domain/C3POTest.java index f323dd8..7d323b5 100644 --- a/domain/C3POTest.java +++ b/domain/C3POTest.java @@ -1,7 +1,7 @@ package domain; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import safety.robot_exceptions.RobotException; +import utility.robot_exceptions.RobotException; import static org.junit.jupiter.api.Assertions.*; diff --git a/domain/Factory.java b/domain/Factory.java index 4c6130f..71a2c0d 100644 --- a/domain/Factory.java +++ b/domain/Factory.java @@ -7,7 +7,7 @@ import java.util.HashMap; public class Factory implements Serializable { private HashMap robots = new HashMap<>(); private int c3poID = 0; - private int r2d2ID = 1000; + private int r2d2ID = 10000; public Factory(){ @@ -31,5 +31,9 @@ public class Factory implements Serializable { robots.put(r.getId(), r); return true; } + + public Robot getRobotOfList(int id){ + return robots.get(id); + } } diff --git a/domain/R2D2.java b/domain/R2D2.java index 035e4f3..a70cba1 100644 --- a/domain/R2D2.java +++ b/domain/R2D2.java @@ -1,11 +1,9 @@ package domain; -import safety.robot_exceptions.ExceptionStorage; -import safety.robot_exceptions.RobotException; -import safety.robot_exceptions.robotExceptions; - -import java.io.Serializable; +import utility.robot_exceptions.ExceptionStorage; +import utility.robot_exceptions.RobotException; +import utility.robot_exceptions.robotExceptions; public class R2D2 extends Robot { /** @@ -20,7 +18,7 @@ public class R2D2 extends Robot { /** - * @see safety.interfaces.RobotInstructions + * @see utility.interfaces.RobotInstructions */ public int[] think(int[] input) throws RobotException { if(isPowerOn()){ @@ -32,9 +30,39 @@ public class R2D2 extends Robot { } } + /** + * Sorts any given array of integers with the selection Sort algorithm. + * @param input + * @return + * @throws RobotException + */ + public int[] selectionSort(int[] input) throws RobotException{ + if(checkArray(input)){ + int small; + for(int i = 0; i < input.length; i++){ + small = i; + for(int j = i + 1; j < input.length; j++){ + if(input[j] < input[small]){ + small = j; +// System.out.println(small); + } + } + int temp = input[i]; + input[i] = input[small]; + input[small] = temp; + } + return input; + }else{ + RobotException robotexception = new RobotException(robotExceptions.MAGICVALUE, getName()); + this.exceptions = new ExceptionStorage(robotexception); + throw robotexception; + } + + } + /** - * @see safety.interfaces.RobotInstructions + * @see utility.interfaces.RobotInstructions */ @Override public String speak(int[] input) throws RobotException { diff --git a/domain/Robot.java b/domain/Robot.java index 06b6c49..4442cc4 100644 --- a/domain/Robot.java +++ b/domain/Robot.java @@ -96,7 +96,6 @@ public abstract class Robot implements utility.interfaces.Robot, Serializable { /** * This method uses Streams to join any given array to a String. - * * @param input int [ ] * @param delemiter String * @return String (array as String) @@ -114,57 +113,11 @@ public abstract class Robot implements utility.interfaces.Robot, Serializable { } } - /** - * Sorts any given array of integers with the insertion Sort algorithm. - * @param input int [ ] - * @return input int [ ] (sorted) - * @throws RobotException - */ - public int[] insertionSort(int[] input) throws RobotException { - if (checkArray(input)) { - for (int i = 1; i < input.length; i++) { - int b = i - 1; - int key = input[i]; - while (b >= 0 && input[b] > key) input[b + 1] = input[b--]; - input[b + 1] = key; - } - return input; - }else{ - RobotException robotexception = new RobotException(robotExceptions.MAGICVALUE, getName()); - this.exceptions = new ExceptionStorage(robotexception); - throw robotexception; - } - } - /** - * Sorts any given array of integers with the selection Sort algorithm. - * @param input - * @return - * @throws RobotException - */ - public int[] selectionSort(int[] input) throws RobotException{ - if(checkArray(input)){ - int small; - for(int i = 0; i < input.length; i++){ - small = i; - for(int j = i + 1; j < input.length; j++){ - if(input[j] < input[small]){ - small = j; -// System.out.println(small); - } - } - int temp = input[i]; - input[i] = input[small]; - input[small] = temp; - } - return input; - }else{ - RobotException robotexception = new RobotException(robotExceptions.MAGICVALUE, getName()); - this.exceptions = new ExceptionStorage(robotexception); - throw robotexception; - } + public String getType(){ + return this.type; } @Override diff --git a/facade/FactorySystem.java b/facade/FactorySystem.java index 6ec5f3e..594242b 100644 --- a/facade/FactorySystem.java +++ b/facade/FactorySystem.java @@ -1,5 +1,6 @@ package facade; +import java.io.FileNotFoundException; import java.util.Collection; import java.util.HashMap; import domain.*; @@ -15,9 +16,10 @@ public class FactorySystem { if(Persistenz.existsSavedData(factoryName)){ try{ this.factory = (Factory) Persistenz.loadFactoryData(factoryName); + System.out.println("Loading of old factory successful"); } catch (Exception e) { System.out.println("Loading of old factory not possible"); - System.out.println(e.getCause()); + System.out.println(e.getMessage()); } }else{ this.factory = new Factory(); @@ -38,9 +40,17 @@ public class FactorySystem { public boolean buildNewRobot(String name, int type){ boolean check = factory.buildNewRobot(name, type); if(check) { - Persistenz.saveFactoryData(factory, factoryName); + try { + Persistenz.saveFactoryData(factory, factoryName); + }catch(Exception e){ + System.out.println(e.getCause()); + } } return check; } + public Robot searchForRobot(int id){ + return factory.getRobotOfList(id); + } + } diff --git a/infrastructure/Persistenz.java b/infrastructure/Persistenz.java index c50b74c..08333f3 100644 --- a/infrastructure/Persistenz.java +++ b/infrastructure/Persistenz.java @@ -8,15 +8,10 @@ public class Persistenz { return new File(name + FACTORY_DATA).exists(); } - public static void saveFactoryData(Object Factory, String name){ - try{ + public static void saveFactoryData(Object Factory, String name) throws Exception{ ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(name + FACTORY_DATA)); oos.writeObject(Factory); oos.close(); - }catch(Exception e){ - - } - } public static Object loadFactoryData(String name) throws Exception{ diff --git a/out/production/Robot_Factory_PR/Main.class b/out/production/Robot_Factory_PR/Main.class index 27517b0d3feea1ca0a3063aed511bf2a506714a3..bea465011120741388563fc37bfd9b6783c8f1c0 100644 GIT binary patch delta 27 jcmdnTvX5oMPDVzS$-5Z6IoTMv7&sV&8C)jwF&O{=XwU`N delta 27 hcmdnTvX5oMPDVzy$-5Z6IXM`(fKZshZ89H|0RU+%1>gVx diff --git a/out/production/Robot_Factory_PR/README.md b/out/production/Robot_Factory_PR/README.md index 43a3495..946006d 100644 --- a/out/production/Robot_Factory_PR/README.md +++ b/out/production/Robot_Factory_PR/README.md @@ -26,8 +26,8 @@ * [Factrory](#-classe-factory-) * ### [Infrastructure](#infratructure-1) * [Persistenz](#-classe-persistenz-) -* ### [safety](#robot-1) - * ### [safety](#exceptions-1) +* ### [utility](#robot-1) + * ### [utility](#exceptions-1) * [RobotException](#-class-robotexception-) * [RobotIllegalStateException](#-class-robotillegalstateexception-) * [RobotMagicValueException](#-class-robotmagicvalueexception-) @@ -45,15 +45,21 @@ # TO-Dos: -* Sortier Algorythem C3PO, R2D2 (mit Ausgabe) +* Sortier Algorythem C3PO, R2D2 (mit Ausgabe) --[done]-- -* Bei Erstellung eines Roboters wird einne SerienNr erstellt +* Bei Erstellung eines Roboters wird einne SerienNr erstellt --[done]-- -* Wichtige getter for Robots (getName) +* Wichtige getter for Robots (getName) --[done]-- -* Exception Classes (Throwable einfügen) +* Exception Classes (Throwable einfügen) --[done]-- -* RobotFactory, die mit enum(RobotType) Objekt von R2 und C3PO erstellen kann +* RobotFactory, die mit enum(RobotType) Objekt von R2D2 und C3PO erstellen kann --[abgewandelt für Exceptions]-- + +* Persistenz einrichten + +* funktionalitäten der UI zusammenfassen + +* funtkionalitäten der UI implementieren * Nexus6(Singleton) implementieren, kann nichts (Illegal-State) @@ -199,9 +205,9 @@ ___ `loadFactoryData():Object -> throws` -## safety +## utility -### safety +### utility

Class RobotException diff --git a/out/production/Robot_Factory_PR/domain/C3PO.class b/out/production/Robot_Factory_PR/domain/C3PO.class index 21073388b0e4c9f56480673d0b91d0ea9f63889a..d7c298d10ac0181fb5d6a07862b59036f9994e3e 100644 GIT binary patch delta 568 zcmY*VT}u>U7(LI-yB}=2uHY6!Gol2xJ0nXZtedr?Yjoq+n)V5bvbMoev=JNRRRsP4 zdFdj$N(Avv6uc;qt^;qpj=&2c@edT1>seb@yO{SqbIy6rb7p=veQk++JNmo@z{jJ- z$WHL;>q_Z)X>oTtn5d&R{asr0Q)vykBj>1?{v;jY{=|7M8B8`D?S>uhuB$p{_#yAi z*>1!(Rt-x+$$uR6EBe69I#Ljr&x-Q`DG8#l%7t>J_-3y7vQjF)&|Ruq0vnU+y-cOi z3j_V^{Tm7a-ZQSZiEAH_Rax8HT0)Plp7@@fN-O6hEYC^B)iPQ=N6mW9f>}-FSE~E9 zx46nL7_w5`_SU{2{&*c3{X<=P3z!&SYzh~6_9Bc7Vz_}e^ufYS^xzgzh8`b-Jntfh zX`&q6K7#ahk-Nhb3!RuCQivdpNg{(v6!$Pp#NwQ~&AWz1F$O^%xXxvPKZwX*L`AG$ zXcCOmqA17t+;4pUJ8~u!S04s0>pc}KoL0Yh@?VA!;-Y3o+YC=IyjHP;Gd4?%)JwRH S67E?EdZhWkwGTLI;NdaBiEzsR delta 241 zcmX@W|AL3>)W2Q(7#JAr7(ym;U1C)$PE1Rke1TbMG7FjLfDCw zcklupK*X8pv=(#kneUu?&$&(gb3p(2eSQIuL#3sEiMWn1G6v?cAfR2IHw30_^)6Ck z>Hb?B3OmZTqxxyRQMoABZb%Q=#dNt^zdEU1J3iqG$XZq9wJB#28YH4HA+Ssni4}e^ z4Es3Y_Yk>0^s~B3X%j|j@DcHrFUYDl%{p5pHb?{GOqpjFSi=|>xx};l^SH>&1N1gV z?uaF_tlmn{?0-HI%y*)!lixsr)m8b>vB;`sX!6!m=Qumc=$qJL&GZmZ3O0CX8#}&3 z3A;Q*^1xUyQREICnq~b!gps6bk9zv>y+Ea8H@&>p6Vh$Wy&~C-?R0Y|{oIL;w&!Z1 NOfT=^eeRGr_yarrIn4k7 delta 328 zcmYL^J5B>Z5Jcb1EO;3skZj8!mI#wTf`pCN{FeVmazqYi;Sie=Ar64WCm`SeMBIUd z6A&SwW>`Tm)ivGK)!nc4EAL;vo}Ph%(~*BOu14=}$)1_=#&uS@I4o04V_1{O(${Oy zjJzGAQ*DfKVP1Z?g-iGTKx-5Q17TZ5m?R;U%>*qxnJm|1)(Gd>U{les#hmPO@m2jo zEnU9HKQePGZV7&25L)5CKdt(I7p!kfP_QG+%j@La49f4Ma}nf)nrC&AA@0K h5!gNlam0{A-DfqZQFR>2!{f5-6H{YRs$*p=CqF%jA@=|P diff --git a/out/production/Robot_Factory_PR/domain/R2D2.class b/out/production/Robot_Factory_PR/domain/R2D2.class index d93fbf913284159b09c3f3ed30c13a252150267b..54b8f8b2f4418d43b9a54a0701bf4e99745ecbf8 100644 GIT binary patch delta 907 zcmY*XO-~b16g{u=+9^Y6p{0PdgCv;P&Wu(0C`v80LQ9LqDv8FA#7Gb#2nj)4xFQDP zS~4qECTxr=KNdC7gry6&{sC7e{sc`F&lEbvG=1;h`|iiN=gf=NS3<-%tAh#xc92 zz4e`by0NsfWWN-h_L>sh`5y8m8j%6JTXd*KrQx5lXT_*Lmv94FU$XJmY5x#$ztwzm z+J$V(6H`q$-$`mOWi)880yu+|fHwbVVg7M`eSPkkfH!fkoV?qDE}RSCJbL*&lbw>;m}S_PsFB^u635&k&`lx3D zDS8&A8>B!(L_SP%3?fdWOx|yko`)pZp|r&9yV1*dj)2o>#dO^YV}#1&xVuKOE3_2W zxqK{O(IsT@7$GO&`@;%xfB?KIG!-*KP@u?fcz+=({v+!esz*|79Z6*!O4VwZ;lUb) t?PWP|zo}G#Sc}}b#4XF*XWCV&uZfI%H$D&R7%(d36gHK*PTPYU{{V&-iN62< delta 490 zcmY+AyG{Z@7=_R5F1xVY1U4wJqKQUfSy1rqDyX29jioU$vCtRr0W3`H%~V!aHWq3u zh|$DY+xi&1gYm3^Rf_rN%zrumm$^+`Ma|Fe*LMI->|L9Wp_%iOvr}0YmV8hXRs>m$ z8W@WqhrGaSzc?jxBBhu2`_ChzSsLhR`66?Rb(6v9Yjk!lhuV+2cB=IyH$ zta8FvYglKufX7~i9`~Ae;d^8eV$9RKfH=lsqlgkF0zVrGY+& TAA=h(xWf#|A%+gOD%kx2N3}&{ diff --git a/out/production/Robot_Factory_PR/domain/Robot.class b/out/production/Robot_Factory_PR/domain/Robot.class index 37b3a753c5284122ecfee5d289b9db603b667524..ea0b3c0137a11690c5c8f574dd092b70e41811f7 100644 GIT binary patch delta 464 zcmYjNIZpyX7=5$I&N6~16+|T>7#8tJw9rJOg)uQoX>GJXM2JveqKOCI7mDjB9(c7< znXHWzRvHsKdw+?Aak6YdG2c7CnPh%^S~L6lE5894!lTBXXgIQ%i6`UQ>!=(uS%3$L z+ZI+sm5Aphe=UWdAZQeXZsi5yl+}tXksjJ^R!hXstx~@-tX3H@$)|LfhMt$cCE0Ck z>QSqM(5hE>QJz+4ESi~IPDl9&9jM!2*u)mawjDdz)pN9lkbSNxjdh0%N61ke+p&TZ zURJtXCr%j}!x=cmxgF!U;J?bd?UFzuEefvrr!8D_OVGxB%*z6iR4TEUrnu)`Hba=6 zWvZn)4h8dQKmtujA}F|u1@s|>5v2KtV{EV!1X1yS-2#a~Yx@g4&w@yp6;n3MCBy`` zR|=RzTquGSK2_g4v09b6%*=vS7i^*PN#WO=A`fz8?I_La3 z)$oqQf%Iewh`1&U1f1y zC4mkSyvO5b*lHm767k0Pq1iGzMi6cBrV|7u(R84(QTnv?{;LMA;kt$!CT`-^#4b$` z-H~vfa$@j3ARg+QDm_#T=Z&d~_lgT`0kMlyPh$E@Bfdp$6U9i_19T z{sAi2E$6HWFIN|EpULYPDCKUG7p{RHtw^xN3*#sn`0ZG2I0a&%;91H~7}WU-exlrO zFbVA(7Mw2R)5R;fx~Vv=yFRUZi#KLDy34F6t11-%;dl$|fQT@KA*cZnO$rvusu_xH zakSbFI`X|7{qR?QcoN|^vct^lj3J9hOJ;DN_v%459$+yZ@>TT0W_u<2S=j(KU=Zb8 zvkk+j#0Yj{6o>KBWl{kR3z5gv91^8W^@3|7tdr{NhZ8$s?LhiTF3 diff --git a/out/production/Robot_Factory_PR/facade/FactorySystem.class b/out/production/Robot_Factory_PR/facade/FactorySystem.class index 2e404a221497b20eec35cb4790ae0fd4d29ae809..df80877cf5da3218eba27874475bf351dd17d5d9 100644 GIT binary patch delta 1200 zcmZ9LT~k|C6o#LDa>5DWG{z8`$uy+pqa@@6($ZE7DcDwNi-uy0TI+WRfd(O|Bvk5G z{OCV8GtTe}xUplaHU%A>UVH7Wqd&kq@4OJ#K5@|LoXOtnoW0h&-gmt_Uxx2Sf5ls&l{;QgA ztXHbb`5-ZTdO2nD6i>UGMz(9535&eV87AGYjiKZ-ityuwU5sF9y_alW<`s9>H`4K{&2?UL|L~m&261@9=1tym`;Am!hnwZ z0+5p23M&|zBJZ*)yN8VO$ zNqm@q(2U5vkJ2wn2bg4#vmEsVoRm3_3DujtCy@})0-6#8m|&f{@QZMa1{6P0Ii3n3O7QdZ%W7sKtUF ez2S|%LsHP_mv}MPw3MeXW-~uXw8)cEbMXg&j>5YFtPc-2V z$c-j$6wqk6F){uFFN{CK#29f-Azql~d^2BXzIWbtW?mLQD|CPT^Zpai&b`;}<4QNF zc%p5|+e9VXOsXuZ*=`T17FA>Ww2&u6tx4D-Le&1O_PE{nskdmL(GD0vSBPdO)?%MB z%00T9Qg&JFW{>?)i{{7JXR_a-jdq3Ceyn-zuUbLH0Y%|d{7$@KCY~5?=u6$4OpJSo z(P?pr!}d?D#?!@7lVcXgIbnzNpsR~+iyltd{d#5B8HF{PoQ+Q=8hVq%$&{PZ^jh?B zPT@)=*8!zqsJ8q6GW#5c7cBa@Xg}BMatAFgaoPT+?|=K$IH<~I6hP|e@;x! z$i&#lv_cKqW^P+rNB$xz=M`z;7j*f-f$$P499hJSER#1+Ff4ZSDy56~7TDhNhCuO- z3_-Ec40Rcr7RV2Opmbn~R>^rSc!iWvA-&bPDv0%XvB4> zz6(yS*v{}fd>M9jM^@OY_((^(M{k$QK}F2)87mx7%;R^wlZsVN$8w_nN4oOmWH{Tm zu=XSRN??qvq6$p${kS$Hc!h2=+hjMYgkE)4K&$k&S*VUPA)XM}5a5#Km}Cl-7IlqG zGb8%E(xh1u!Zj(Wj=J@<*D?Mzyo{S!N`lKRA*soWB2wHI TAZG}U#J?{C=IrrYb)^E%B`ETz4z%9JmGB$<$D*D8L z+!cLU8?_Q)!iD)yyv;KnYT{8?vmlTfGyu^apOY4_us5nb-a|GHk!N$ zg|`yuMHV^6%d8Y!L4>)6HtrMhK}^a@V}f~wY${{FTxyGd+G3_4nC_;2pb^DMIA_T9@*nLb}+bup+agKsrl6Q1~TdI9B;MIP3lv$ yaGDmPEfx~Z%S8DD5AcwJy?mYmZM9lZF(2|RV3Dz%s3oovp0P5RmGJ^Ah#diJC0K0$ delta 616 zcmYjOO-~b16g_XI)2ZWhKte$p9SdbB@~I+zA&Md>*ii%&Dj#NOCQ-q*>C{A4#H~B? z{s0@}&d5d*NL;zml^cJBiNAmt&rBL&G54K&-+AYrd*_#RU>QID?tKMt1J8DhO(EZ_ z&8m(r`BvDXTW*U}$s8;L4th;!=#$^Y>4bv;6N5M>|A?-*gLWN5GOf&tEAo}{Q!cBH z997R)$+?vW8zKGuhd?YOMx_E!`7^UIn3*LY~nbcNH_M)SrjnE zq*tt!tD6IXUu8N~D*4s%4KE1%K*y4RBR$PFI`if7`s<306}hVQXD>kE6ar~n#4yiG z%oJQkj95dQ@v8i!wdAg`9%f*5gwd?y>lkHrjC;5laer$aLx@5-x3@kb=I%tgHrkQpO{kP+Um%GTEaC>(XyR=nI?x=cXUI!YbsTr1S+bbG zBwtW9>L_rRScl^2tdMvQQzVA%U)I}a_Td!vw~#CJ?2&+7oZUrFzV{3IU54|0pGj6C zH%;6O(8`V{>86ct(*Iomnfi<={+Map=PaT7JpCwe`7YdQIM;(n?;&P*CRlsKZ=n$d NrUv0tEMpaI{{XLhS2O?s diff --git a/out/production/Robot_Factory_PR/safety/interfaces/Robot.class b/out/production/Robot_Factory_PR/safety/interfaces/Robot.class deleted file mode 100644 index abedae173659d9f1b80581892238f3f1b47eb7fd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 190 zcmX^0Z`VEs1_nC@ZgvJHMh5ZX#I)3sO8v~dlGLKK#N^as{h<7${1SEs7Dfhvti-ZJ z{hY+SbbbG%tkh(nC>tY#91bnc`FSNp`8n(i9E=RgIMjIN6_*s1CYNO9=M^(Da0Ta= o7A2>;W#*&;IbeJBKvn`RVPs%tU}9ipUt<8 diff --git a/out/production/Robot_Factory_PR/safety/interfaces/RobotControl.class b/out/production/Robot_Factory_PR/safety/interfaces/RobotControl.class deleted file mode 100644 index bf76523e4a4bd0f96d27c843be4faa5ca388a6bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 319 zcmYjNyG{c!5F7_CN5U&X)YJ(D_W?*W2&70+5^)j*4RXxJI67?PTL}DG3O<03LhM=L z(Rl3L*_|1Geyu+MT%ez$rEpT~1@U{~JX2g~Lv?Wz=7BGR=NPIS+X}s#y)CBm zB^g%8Eb-_;VQVlPDdh5+=qFM*9t_8S?2@DN_FUmeF4j_Fcl8vY@zoJtOZdX diff --git a/out/production/Robot_Factory_PR/safety/interfaces/RobotInstructions.class b/out/production/Robot_Factory_PR/safety/interfaces/RobotInstructions.class deleted file mode 100644 index 78060e1e88272a6b2cbb656a57e6d13c05a25c40..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 276 zcmZXP%?d$56vzML<6hrcc>yIh?gJ=0>XuUO(n4c87&KQiL%f=W2k=mGZiKQrpZ$L4 z+#lB)fFT+oasq89SL82|HlFNCDss^*U8X)Z&fBB%IyEjtL7=&nCmHRfSx3|5mXsGL zx&z6bK&v~Cdz0@x@m8DlK%g=@D>}RxWr5CHW;4TrKEs#tv&>|_(T2%EMxMt^O46fM pG}e1!-`|D(Odbdb(yA|`ZJP98B0sbg) zwrUUB?7%Q@nD=I8=i~G39YBJu01Y&Kcp(?zQ_krTQxjX2B-yE@{aubB6k02N zDU9LybeezbG6a1!(L-@A-Mrg#S|2+ScHz@q++$>P8S+bnF3=+$TEjY3({~YSVDk(5zmU5C diff --git a/out/production/Robot_Factory_PR/safety/robot_exceptions/ExceptionStorage.class b/out/production/Robot_Factory_PR/safety/robot_exceptions/ExceptionStorage.class deleted file mode 100644 index d64342727f6d8c6696a54ca2788a7bed34735704..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1067 zcma)5ZBNrs6n^d)D=Qt~1{(uk5K*_H_N!rrFABk=LnDN*=5D*2C2MQi3(CLJL?ZEn zKfoVleA7T#9egoLXGZPt18OU0gMowViSe{C!FN2=*u63;1 zS|Inz3p~9oFjcD`LgNAK5H)wVrS=4JkVhzdrH9Y zRUD^M&Aln=Ljp4jZOmX!pmfH^X*QisXKin9%lEh9*u(;E3aE^w(XWHB48ebCsAANdP#Xp*O|UZCWMFVb%y(%;mf^EB{rVt6a*Ll z0l#b1PI#Z?S+##c*qi4tiiHczH!rZXZ$CfB>UUmd2nVbn$FE8ES>y>hj{=u*4$G9* zd1DWN@CX~!2$?44NEq`NPl!??LX{*E3QtEA-ts1)T1eB|%si2Hj_yE_oJ&l)n5HTZ r0!FC{!&Lk|Q6E<3@Dz-kwtv9*MqyAzE;UwC7;E4#gyA}*UYq{_8nymX diff --git a/out/production/Robot_Factory_PR/safety/robot_exceptions/RobotIllegalStateException.class b/out/production/Robot_Factory_PR/safety/robot_exceptions/RobotIllegalStateException.class deleted file mode 100644 index 207e044fe25f8aabdb465d32a28977618a9ab145..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 545 zcmZ`$O-sZu5Pj*^R%>^1yem|3J%uFS1?F2ux0RX5SKOvyrNTS0k>a#Xm{cJjjOOv~$?*Rx$N5vk55=I@y0$WeA1V zN{>a;@Uk81-|`GWrlz_Om(q^C-95pvor9=(FSQ0O2a kZ*L1K^N6@i(av`nLaY!X0#?x{5gV;xovP{c2szmN0`jw&3jhEB diff --git a/out/production/Robot_Factory_PR/safety/robot_exceptions/RobotMagicValueException.class b/out/production/Robot_Factory_PR/safety/robot_exceptions/RobotMagicValueException.class deleted file mode 100644 index 4d7d141da70251cea933f68a4a81b6abfc72dbe6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 539 zcmZ`$O-sZu5Pj*^t=8)Lbrtj?u8I|}m0mn$ZqmhRMP{5jN*?(W4@+JZ;mBxN711#DFwbz*rOCmo_wSkvfzVp% zv8Zcav?KjnoWUQdM(5&O+MzeQ`X5>*w&Bs4>|Ej4FSpNbNXO?UL diff --git a/out/production/Robot_Factory_PR/test_factoryFactory.ser b/out/production/Robot_Factory_PR/test_factoryFactory.ser index 9e074535e16ff19951895318fabd3811b2c69f99..45cdbe0f50cd4e081e18b457b8396e2a52c2534b 100644 GIT binary patch delta 156 zcmdnQ{E>Nr7{@d2+H##I?%OBI*)qPI7~{jpG;w8&vg)kUf8WngOk!eSs3>CKNy*Pm z%*@jZ%1_EK+4Hh<-_@7O4U;t(<=M4;N=q_xGAH{oMtBFLmZTPyFt9iq2ly8kGSo4! vGB7Z|C@x~)hG{o)F?wMW*K|g#qXT3xNDU`Q4MPD?n@4I<5|9c4DyjegpcFK* delta 93 zcmV-j0HXi#1F{2<76{Yd+zMOwssWK6Jpt&ETucE0k*QoG%MoWMghu!;0ssJbasUiu zZ*5^|ZZ1-9VsCT{U&~4cIXi5VC;=Y^Dok@>W@VF30ay)4WpZL^bN~cHGf+=>Iuaj7 diff --git a/out/production/Robot_Factory_PR/ui/UI.class b/out/production/Robot_Factory_PR/ui/UI.class index 0cda82e92cbb542ccfa27665cffd283674cd62d5..50def97afb2f64c0523517d21796cf4c96b0ee9b 100644 GIT binary patch delta 1770 zcmY+E`&U#|6vw}3n3;PS#wkG&WPmG`0W#u)ST0c%QIJHJ5AxBn?8;o2(cxa489*wV zQY#b8^k`-eGkc7^(`+&_t+o20)qhaG^izL9zqDGJea~eg{9*Rl_w0T4*`K}lnIjb^ zsslg&GjS6@D}J~VIO-8$dCD_OUiA3nB~OzUjx3HCk%;`oQ?WA~S)%lav3Dq*h#Iyv zVkDitPFn3nbgUN$N0z!CYQq>xS<~#w<6-5|H042`bqC{VL#{6PsVsmJm_h7?UqI*4 zttzsPs0@3nM4xQ&-d`6Jm=U*!%|twE#O=W$n)lJU({ZB4no%o&2ogaIz?R3nbz)Fn z_107;1DT8B(sFHj1DtTFNDDp$Vhu0|2%ir`!+v}XwQtkl7@M0!q3FcrHD!BWGYx7Ws z@h0BlsMP7+{ zv=#Ew)!<$oR!JNTtCyLc5%Iaw3fAeyBen3GvrpTnbB zgt4 zT#FECN=aIU1(?qS7m})(vXx|ASd3VPMRCxCVLZfO%?!1S!B#R{3x{k4&QL#x)nsaO zi(sID2Up=8Tq4*wbi9lAs1Yn*7*&oE6yk663%}p*`3u?_4VJ3L?*FQR8~pOqvAwwd z8p?9m-@V}G1uRlY~7*oHFnaOxgm_qMZ3JDB=TV(vne^-JM#9EOSG=$!&)f_cm`+9zkSC49MX1Q70CsKmFv8N$)t?aFWPZHT4-w{PGkzDN1L1ubx( delta 1311 zcmZ8gTXR!Y6#n+fNzTd11??pytxb=`RMYk#p;!cL8CtNdbi^w&QZKY7+DMwjCT*#p z5vg($v24XEf(q4)MC5`Nk)LU)O4La?c4?w8Ymen}_EcfKP%haHKNI%~M4io! zJwBbyrR{uXcGX<74k>H5V`nCd^(C zvcbfdKw#P~PGw4^Oxo@?@wDvG<9bG*Reo-?cA9urAe7C|jODUvJDV>~mrY~^%)vq- zZTHV*EI2q6L=Kbkik=h&`Gejjo|ixCEutht-lUk8TfG~^tQ_?w{BuD(g%<=O@>^eh zXgGPGj;%Qw#EW=Ie(D|6kD53pfAzM@CSy{ZmM4vZxgemI=ZYEGU^?MN3-97R0~b}u z`*NT8owzKA{4Fx&kBAQ`r5Xi-!})w>Y9Kepl1c`y3MAwaGvPDvu|S++T>j$k3V0#l z#Vg#8%MQ!gHBTxL-T>>MBaAxSg!Q-?&8Ww#u1({93tqzso=R$>O}HrCF3O^{zoJk& zU~zA#p)?XDf;gf`(!UEaHmn(&(1Lr=`Y+_(HRN90iZ&vibWuDj4AKnL8#o1F;7(5f z8u5H8Cm=?tDP~JwV9Tn89X(braw&f^8?<-FOq*ut@nLdU2Hzs_8a7j2plidI@@%IEy#j z;+AUdQcbFdAAj(n`h1r5J2o2q2GXiYkN?vod`-OyW2n7y z1W=>FIvP5!qf%1?%J1d>l+i=-!2Kk+k8k+_zQ70B(1$phhdG8vNb*q(a(-z%h7v~k zFFc9UIJj0CsniOJ(!Tm8cMKCqavGXjTL|7ik><-3;Q;IL;4Nm<@HQ^+3{!fC)m?J; Q5AYH1Eb3RVgijFr8|u&R8UO$Q diff --git a/out/production/Robot_Factory_PR/utility/interfaces/Robot.class b/out/production/Robot_Factory_PR/utility/interfaces/Robot.class new file mode 100644 index 0000000000000000000000000000000000000000..c5ef4638f498732d8c58e6ef065fa35504ac1ff4 GIT binary patch literal 193 zcmX^0Z`VEs1_nC@ZgvJHMh1z}lFXdUl1lx|ypq(Sw8Z4pV*Q}}r2G=IMD!3GR<`tI|l_r;D=I0eNGH?aw pmlh?bx@G310y$ut^+1*atzl$fW?*7qWnc$7mjTG*1d>b)TmS~nHuwMl literal 0 HcmV?d00001 diff --git a/out/production/Robot_Factory_PR/utility/interfaces/RobotControl.class b/out/production/Robot_Factory_PR/utility/interfaces/RobotControl.class new file mode 100644 index 0000000000000000000000000000000000000000..6db39f04fd1479c7ef73a64be4c320b2e578467f GIT binary patch literal 321 zcmYjNO-lnY5Phj`*VeCAynAgC+#eu#5rsl&iwhpSNE*kOvL=$9TK#K1_yhb=;%u<$ zB`=wIGw;28eyu+MT%ez$rEs!jS2=z!oM(!U+E88Ggn8i0;5mjW$F@RmpW_^ zd_jg4GD|#qP}mv_M+&*TCiAG_q}yggSql8dzzXJJLLTsbyRY4%p3y}{|4PCoR9QFUlIcvPN6+}ut g0mvj>hBlg%Id&3u&`r3Dy@dNX5T?SRoGtXe0nqVMFaQ7m literal 0 HcmV?d00001 diff --git a/out/production/Robot_Factory_PR/utility/interfaces/RobotInstructions.class b/out/production/Robot_Factory_PR/utility/interfaces/RobotInstructions.class new file mode 100644 index 0000000000000000000000000000000000000000..7e1d54f8af126b0b18876b328c351d8e2149e576 GIT binary patch literal 278 zcmZXPNeaS15Ji7GB+j_<1cJIT2N2vT1O!2sE~IT*Z4DjiR79`l!UK3Hv4SJGs*(4q zZuiR-zz_`|Ie~UcCNgvmj3w>XQt2d^#jBV?n~+Ntnb;;i3IffYJjx)Fb`wljJFQ5d zm>jg+3$(h6us8Y6=j4pt3d*A){A@Ftw#G8r%g~FEQS&%; qN{>yXS@?HiKeKxR0(t%p$nnKRcwGBj6*!i-Q$h8&!+9;+Mg0M;j7Ql3 literal 0 HcmV?d00001 diff --git a/out/production/Robot_Factory_PR/utility/robot_exceptions/ArrayEmptyException.class b/out/production/Robot_Factory_PR/utility/robot_exceptions/ArrayEmptyException.class new file mode 100644 index 0000000000000000000000000000000000000000..19a7b23052ddd542f9f1219cde77ed662086c94f GIT binary patch literal 529 zcmZ`$O-sW-5Ph4*Mq{*o9X#qut)=+^k%~wKA$qXVt8C&@SJG_RY{dL5Pl5-3fImu{ zjoO1YJ21=}=DnHO`S^T$2Qa{n4+kv|Zh$4U84gM#Gij<&t3;VQ@tlg8kt#338=DyZ zVutpK%%vGHoF2xFq*`T8Dx&z2Kk+c*`6L_}E%QlqH1@E}&})=9)0$Vq>C9Af9R~MY z-3x|JEOT*PP7|STd6H3PD^@Ab##~E_f0C|wkOf1(dCmn*BI;tQ8EJN#d4Km~2!z&3 zUx}jNlX{+i8#DMLRq9k+NIUWFg5G^g!ah7Yj(v=b&O?5M&?Q=AfY&|ly@I_^=)fm$ iZ;86Fja7>FzRM6`jSvyAjt+^~Xak#6O&>dy{AY literal 0 HcmV?d00001 diff --git a/out/production/Robot_Factory_PR/utility/robot_exceptions/ExceptionStorage.class b/out/production/Robot_Factory_PR/utility/robot_exceptions/ExceptionStorage.class new file mode 100644 index 0000000000000000000000000000000000000000..077567460614ccf74389e88d532eb34fc63adfe6 GIT binary patch literal 1100 zcma)5*>2N76g`v8P3klyTa%WhK!Gf@enk!H3$!YdQxK{0iYCbs00*Q)> z2R?w0LR>pblS)DL!z_2sJ?C!z^Y_uq`hX!?skW0?LDE3V#41dN>PX9>)EAbgI!b>KU%KLxmdf?5!|Ac5mB$By!El7{ zho`E&)a`x1GxKe%V2vSnL7&xZTD{)(@$tUn?E8KS>$qbeYa)j{!=o^4EgfO?mFIA6 zz2;h+()}pBYT+>?RsS8=baWYBRP5_aTiTQEpiv#0{>#!xp@GeTG<%;$f&Q7Zel^sSyz{ zJfJla3^x55k)SWMN68*11kD)TMr4oCUatKFtJN=IWYbs3G_O!NsqJ23>wD<>nAS}s zXk8_^i6qj KLt_`BcK-pR_6b!0 literal 0 HcmV?d00001 diff --git a/out/production/Robot_Factory_PR/safety/robot_exceptions/RobotException.class b/out/production/Robot_Factory_PR/utility/robot_exceptions/RobotException.class similarity index 54% rename from out/production/Robot_Factory_PR/safety/robot_exceptions/RobotException.class rename to out/production/Robot_Factory_PR/utility/robot_exceptions/RobotException.class index c3c0717b5e6ab88061d30bedf8ec024170b1bf8a..fdcc11e68c5a663e8556ab741389fdaf9f4cee54 100644 GIT binary patch delta 104 zcmaFQ^_6RaB%69^NoG#wnt WQIv{Iwqmki*Mut<+1$hQmbqP)`P1x#0&0IN?L{r~^~ diff --git a/out/production/Robot_Factory_PR/utility/robot_exceptions/RobotIllegalStateException.class b/out/production/Robot_Factory_PR/utility/robot_exceptions/RobotIllegalStateException.class new file mode 100644 index 0000000000000000000000000000000000000000..a058331406fb472ca9d6ec41b40943789b1d00c9 GIT binary patch literal 550 zcmZ`$O-sW-5Ph50L~FEu-PMy?#T>*_r5;3~5Ik7vRW@;nE8A?@Y{dR7Pl5-3fImu{ zjoO2Drskl(V4b);yD*nD|J~VH!gAc ziy6W*SxP%#INwjbq()^FmzK{itBok33JOcMVXCM=Uk1skq-YP+x9_L45$8a{k{6s%+97H-SgA`Zp#o0 zW3-uws^Ud6*1!E3IwM`1TwF;v__lw9W5>lVBD$D+jErtZeu>Z!EixeL9Ui@cy-*mS lL*5-2R2C9(nWCNVGQ?ORL!#Y*d_Yn%P`33!-o45b~ literal 0 HcmV?d00001 diff --git a/out/production/Robot_Factory_PR/utility/robot_exceptions/RobotMagicValueException.class b/out/production/Robot_Factory_PR/utility/robot_exceptions/RobotMagicValueException.class new file mode 100644 index 0000000000000000000000000000000000000000..90d2da7735c78897639ffc8198d0417f257885fd GIT binary patch literal 544 zcmZ`$O-sZu5Pj*^R%>9MG5UbI8~+npg8sYd7GLfWx6y9PM4Ol-raTiM6R=vw3#2wkE_2Ka;hgIBN@3LOOG j?P<{#dRU}r>$?mgmIx66%jlDcjaINq)%10Q9ISr<4ceI* literal 0 HcmV?d00001 diff --git a/out/production/Robot_Factory_PR/safety/robot_exceptions/robotExceptions.class b/out/production/Robot_Factory_PR/utility/robot_exceptions/robotExceptions.class similarity index 57% rename from out/production/Robot_Factory_PR/safety/robot_exceptions/robotExceptions.class rename to out/production/Robot_Factory_PR/utility/robot_exceptions/robotExceptions.class index f8480197e869b26374eba7ad72a974b9adfa7b84..d731254ecbdfd946cbf00dae168a91b472306554 100644 GIT binary patch delta 133 zcmX@XeU4l7)W2Q(7#JAr7+l#Im>3x}N=q_xGAEy6Ql4lo&93DG3zrs)IasZ6YMVb_X=b2q*# zVdT`&(1eSqO`gQ0BxS4Nla*MOsGpOVm#!aNQk0pOZVfkMg_t#xtZQCrt_|G0&6}8I Fm;haTFs=Xq diff --git a/test_factoryFactory.ser b/test_factoryFactory.ser index 3648c0ee63bb598e2cc7d3efc4f031f7b7080f0d..45cdbe0f50cd4e081e18b457b8396e2a52c2534b 100644 GIT binary patch delta 155 zcmcc4{E>Nr7{@d2+H##I?%OBIS+X)RFfhNI7_(AYb=K*>?`J3`F)=Vy6fy9mPzK@$r_CE?Aku1C7C&ylYJQ@yaQ58Qj1C$Se%Um{EG`2>KIso troAXGV&H~pH*zt0VH4MMMy#U)WH3k#CrAxL0Z^MqYEcr93IZys000G>GoAnd delta 129 zcmey!e4TlM7{}%NcetXzuVS1iXUWRMz`*=sV$4eA(}L;hEp9*bfdUmp3_L0Mxrv#1 zdO`U~`6b-(r@h!Lt#c-8Fv_!O`4lInrB3!^j4<*@ElSEPVPJ7K4)8B7WT<0cWnf@n U1hY6mEQW#-23C-wVyL1D0J~HrmjD0& diff --git a/ui/UI.java b/ui/UI.java index 6317070..4addbf7 100644 --- a/ui/UI.java +++ b/ui/UI.java @@ -1,5 +1,8 @@ package ui; +import domain.C3PO; +import domain.R2D2; +import domain.Robot; import facade.FactorySystem; import infrastructure.Persistenz; @@ -34,12 +37,12 @@ public class UI { mainloop: while(true){ System.out.println(); - System.out.println("______________________"); + System.out.println("____________________________"); System.out.println("Sie haben folgende optionen:"); - System.out.println("-1- show all robots ----"); - System.out.println("-2- build new robot ----"); - System.out.println("-3- empty --------------"); - System.out.println("-4- Exit ---------------"); + System.out.println("-1- --- show all robots ----"); + System.out.println("-2- --- build new robot ----"); + System.out.println("-3- ------- use robot ------"); + System.out.println("-4- --------- Exit ---------"); System.out.print(" > "); try{ int input = Integer.parseInt(sc.nextLine()); @@ -47,7 +50,7 @@ public class UI { case 1: listAllRobots();break; case 2: buildNewRobot();break; - case 3: System.out.println("u pressed 3");break; + case 3: useRobot();break; case 4: break mainloop; default: System.out.println("this is an invalid option"); break; @@ -94,4 +97,18 @@ public class UI { System.out.println("Anlegen des Roboters fehlgeschlagen"); } } + + private void useRobot(){ + System.out.println("Which robot do you want to use?"); + listAllRobots(); + System.out.print(" ID > "); + int input = Integer.parseInt(sc.nextLine()); + Robot r = fs.searchForRobot(input); + System.out.println("You choose " + r.getName() + " of type " + r.getType()); + System.out.println("Yout have following options"); + mainloop: + while(true){ + + } + } } diff --git a/utility/interfaces/Robot.java b/utility/interfaces/Robot.java index b7b8bb6..474b644 100644 --- a/utility/interfaces/Robot.java +++ b/utility/interfaces/Robot.java @@ -1,5 +1,5 @@ /* (c) 2012 Thomas Smits */ -package safety.interfaces; +package utility.interfaces; /** diff --git a/utility/interfaces/RobotControl.java b/utility/interfaces/RobotControl.java index 945f9e4..b204e0e 100644 --- a/utility/interfaces/RobotControl.java +++ b/utility/interfaces/RobotControl.java @@ -1,5 +1,5 @@ -package safety.interfaces; -import safety.robot_exceptions.RobotException; +package utility.interfaces; +import utility.robot_exceptions.RobotException; /** * Das Interface repräsentiert einen einfachen Roboter mit seinen Funktionen. diff --git a/utility/interfaces/RobotInstructions.java b/utility/interfaces/RobotInstructions.java index 9604568..8d4d3c4 100644 --- a/utility/interfaces/RobotInstructions.java +++ b/utility/interfaces/RobotInstructions.java @@ -1,8 +1,8 @@ -package safety.interfaces; +package utility.interfaces; -import safety.robot_exceptions.RobotException; -import safety.robot_exceptions.RobotIllegalStateException; -import safety.robot_exceptions.RobotMagicValueException; +import utility.robot_exceptions.RobotException; +import utility.robot_exceptions.RobotIllegalStateException; +import utility.robot_exceptions.RobotMagicValueException; /** diff --git a/utility/robot_exceptions/ArrayEmptyException.java b/utility/robot_exceptions/ArrayEmptyException.java index 9f84044..6ec8001 100644 --- a/utility/robot_exceptions/ArrayEmptyException.java +++ b/utility/robot_exceptions/ArrayEmptyException.java @@ -1,4 +1,4 @@ -package safety.robot_exceptions; +package utility.robot_exceptions; public class ArrayEmptyException extends RobotException{ public ArrayEmptyException(robotExceptions type,String errorMessage){ diff --git a/utility/robot_exceptions/ExceptionStorage.java b/utility/robot_exceptions/ExceptionStorage.java index 4d1b342..289976c 100644 --- a/utility/robot_exceptions/ExceptionStorage.java +++ b/utility/robot_exceptions/ExceptionStorage.java @@ -1,9 +1,10 @@ -package safety.robot_exceptions; +package utility.robot_exceptions; +import java.io.Serializable; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; -public class ExceptionStorage { +public class ExceptionStorage implements Serializable { private RobotException message; private LocalDateTime date; diff --git a/utility/robot_exceptions/RobotException.java b/utility/robot_exceptions/RobotException.java index 26bcc23..e8d1485 100644 --- a/utility/robot_exceptions/RobotException.java +++ b/utility/robot_exceptions/RobotException.java @@ -1,4 +1,4 @@ -package safety.robot_exceptions; +package utility.robot_exceptions; public class RobotException extends Exception{ robotExceptions currentType; diff --git a/utility/robot_exceptions/RobotIllegalStateException.java b/utility/robot_exceptions/RobotIllegalStateException.java index ddfd269..5dcd6b7 100644 --- a/utility/robot_exceptions/RobotIllegalStateException.java +++ b/utility/robot_exceptions/RobotIllegalStateException.java @@ -1,4 +1,4 @@ -package safety.robot_exceptions; +package utility.robot_exceptions; public class RobotIllegalStateException extends RobotException{ diff --git a/utility/robot_exceptions/RobotMagicValueException.java b/utility/robot_exceptions/RobotMagicValueException.java index 9bd1fa4..2fb8d2b 100644 --- a/utility/robot_exceptions/RobotMagicValueException.java +++ b/utility/robot_exceptions/RobotMagicValueException.java @@ -1,4 +1,4 @@ -package safety.robot_exceptions; +package utility.robot_exceptions; public class RobotMagicValueException extends RobotException { public RobotMagicValueException(robotExceptions type, String errormessage) { diff --git a/utility/robot_exceptions/robotExceptions.java b/utility/robot_exceptions/robotExceptions.java index 12b7f10..8ac8e3d 100644 --- a/utility/robot_exceptions/robotExceptions.java +++ b/utility/robot_exceptions/robotExceptions.java @@ -1,4 +1,4 @@ -package safety.robot_exceptions; +package utility.robot_exceptions; public enum robotExceptions { ILLEGALSTATE("ist in einem illegalen Zustand"),