From 3dac4fed82be324b2cb8d1b04732b5e2827a9c15 Mon Sep 17 00:00:00 2001 From: Philipp3107 Date: Tue, 3 Jan 2023 01:18:57 +0100 Subject: [PATCH] implemnted serialisation and saving. First part of UI --- Main.java | 114 +++++++++--------- domain/C3PO.java | 5 +- domain/Factory.java | 32 ++++- domain/R2D2.java | 6 +- domain/{RobotBasics.java => Robot.java} | 13 +- facade/FactorySystem.java | 37 +++++- infrastructure/Persistenz.java | 17 ++- out/production/Robot_Factory_PR/Main.class | Bin 2045 -> 574 bytes out/production/Robot_Factory_PR/README.md | 8 +- .../Robot_Factory_PR/domain/C3PO.class | Bin 1535 -> 1640 bytes .../Robot_Factory_PR/domain/C3POTest.class | Bin 3566 -> 3580 bytes .../Robot_Factory_PR/domain/Factory.class | Bin 0 -> 1308 bytes .../Robot_Factory_PR/domain/R2D2.class | Bin 1309 -> 1414 bytes .../Robot_Factory_PR/domain/Robot.class | Bin 0 -> 4316 bytes .../Robot_Factory_PR/domain/RobotBasics.class | Bin 4001 -> 0 bytes .../Robot_Factory_PR/facade/Factory.class | Bin 517 -> 0 bytes .../facade/FactorySystem.class | Bin 0 -> 2070 bytes .../infrastructure/Persistenz.class | Bin 1871 -> 1916 bytes .../exceptions/ArrayEmptyException.class | Bin 489 -> 0 bytes .../RobotIllegalStateException.class | Bin 510 -> 0 bytes .../exceptions/RobotMagicValueException.class | Bin 504 -> 0 bytes .../robot/interfaces/Robot.class | Bin 187 -> 0 bytes .../robot/interfaces/RobotControl.class | Bin 311 -> 0 bytes .../robot/interfaces/RobotInstructions.class | Bin 268 -> 0 bytes .../safety/interfaces/Robot.class | Bin 0 -> 190 bytes .../safety/interfaces/RobotControl.class | Bin 0 -> 319 bytes .../safety/interfaces/RobotInstructions.class | Bin 0 -> 276 bytes .../ArrayEmptyException.class | Bin 0 -> 524 bytes .../robot_exceptions}/ExceptionStorage.class | Bin 1032 -> 1067 bytes .../robot_exceptions}/RobotException.class | Bin 1349 -> 1391 bytes .../RobotIllegalStateException.class | Bin 0 -> 545 bytes .../RobotMagicValueException.class | Bin 0 -> 539 bytes .../robot_exceptions}/robotExceptions.class | Bin 1438 -> 1480 bytes .../Robot_Factory_PR/test_factoryFactory.ser | Bin 0 -> 434 bytes out/production/Robot_Factory_PR/ui/UI.class | Bin 237 -> 3459 bytes test_factoryFactory.ser | Bin 0 -> 471 bytes ui/UI.java | 76 ++++++++++-- 37 files changed, 220 insertions(+), 88 deletions(-) rename domain/{RobotBasics.java => Robot.java} (93%) create mode 100644 out/production/Robot_Factory_PR/domain/Factory.class create mode 100644 out/production/Robot_Factory_PR/domain/Robot.class delete mode 100644 out/production/Robot_Factory_PR/domain/RobotBasics.class delete mode 100644 out/production/Robot_Factory_PR/facade/Factory.class create mode 100644 out/production/Robot_Factory_PR/facade/FactorySystem.class delete mode 100644 out/production/Robot_Factory_PR/robot/exceptions/ArrayEmptyException.class delete mode 100644 out/production/Robot_Factory_PR/robot/exceptions/RobotIllegalStateException.class delete mode 100644 out/production/Robot_Factory_PR/robot/exceptions/RobotMagicValueException.class delete mode 100644 out/production/Robot_Factory_PR/robot/interfaces/Robot.class delete mode 100644 out/production/Robot_Factory_PR/robot/interfaces/RobotControl.class delete mode 100644 out/production/Robot_Factory_PR/robot/interfaces/RobotInstructions.class create mode 100644 out/production/Robot_Factory_PR/safety/interfaces/Robot.class create mode 100644 out/production/Robot_Factory_PR/safety/interfaces/RobotControl.class create mode 100644 out/production/Robot_Factory_PR/safety/interfaces/RobotInstructions.class create mode 100644 out/production/Robot_Factory_PR/safety/robot_exceptions/ArrayEmptyException.class rename out/production/Robot_Factory_PR/{robot/exceptions => safety/robot_exceptions}/ExceptionStorage.class (52%) rename out/production/Robot_Factory_PR/{robot/exceptions => safety/robot_exceptions}/RobotException.class (55%) create mode 100644 out/production/Robot_Factory_PR/safety/robot_exceptions/RobotIllegalStateException.class create mode 100644 out/production/Robot_Factory_PR/safety/robot_exceptions/RobotMagicValueException.class rename out/production/Robot_Factory_PR/{robot/exceptions => safety/robot_exceptions}/robotExceptions.class (57%) create mode 100644 out/production/Robot_Factory_PR/test_factoryFactory.ser create mode 100644 test_factoryFactory.ser diff --git a/Main.java b/Main.java index a67aecf..7b9e807 100644 --- a/Main.java +++ b/Main.java @@ -1,69 +1,71 @@ import domain.*; +import facade.FactorySystem; import safety.robot_exceptions.RobotException; import ui.UI; public class Main { public static void main(String[] args) { + FactorySystem fs = new FactorySystem("test_factory"); - UI ui = new UI("test_factory"); - - int[] input = {42,6,5,4,3,43,1}; - int[] input2 = input; - C3PO Herbert = new C3PO(1, "Herbert"); - R2D2 Herb = new R2D2(0, "Herb"); - int[] input3 = {}; - - //Herbert.triggerPowerSwitch(); -// Herb.triggerPowerSwitch(); - + UI ui = new UI(fs); +// int[] input = {42,6,5,4,3,43,1}; +// int[] input2 = input; +// C3PO Herbert = new C3PO(1, "Herbert"); +// R2D2 Herb = new R2D2(0, "Herb"); +// int[] input3 = {}; +// +// //Herbert.triggerPowerSwitch(); +//// Herb.triggerPowerSwitch(); +// +// +//// try{ +//// String sorted = Herb.speak(input); +//// System.out.println(sorted); +//// } catch (RobotException re) { +//// System.out.println(re); +//// } +// // try{ -// String sorted = Herb.speak(input); -// System.out.println(sorted); -// } catch (RobotException re) { +// int[] sorted = Herb.think(input); +// for(int i = 0; i < sorted.length; i++){ +// System.out.print(" " + sorted[i]); +// } +// }catch(RobotException re){ +// re.printStackTrace(); +// } +// +// System.out.println("last exception thrown"); +// String re = Herb.getLastException().toString(); +// System.out.println(re); +// +// Herb.triggerPowerSwitch(); +// +// try{ +// int[] sorted = Herb.think(input); +// for(int i = 0; i < sorted.length; i++){ +// System.out.print(" " + sorted[i]); +// } +// }catch(RobotException e){ +// e.getLocalizedMessage(); +// } +// System.out.println("last exception thrown"); +// re = Herb.getLastException().toString(); +// System.out.println(re); +// +// //System.out.println("Was neues ausgeben"); +// +// //just some testing +// /*C3PO Herbert = new C3PO(0, "Herbert"); +// int[] input = {6,5,4,3,2,1}; +// Herbert.triggerPowerSwitch(); +// try{ +// String asString = Herbert.speak(input); +// System.out.println(asString); +// }catch(RobotException re){ // System.out.println(re); // } - - try{ - int[] sorted = Herb.think(input); - for(int i = 0; i < sorted.length; i++){ - System.out.print(" " + sorted[i]); - } - }catch(RobotException re){ - re.printStackTrace(); - } - - System.out.println("last exception thrown"); - String re = Herb.getLastException().toString(); - System.out.println(re); - - Herb.triggerPowerSwitch(); - - try{ - int[] sorted = Herb.think(input); - for(int i = 0; i < sorted.length; i++){ - System.out.print(" " + sorted[i]); - } - }catch(RobotException e){ - e.getLocalizedMessage(); - } - System.out.println("last exception thrown"); - re = Herb.getLastException().toString(); - System.out.println(re); - - //System.out.println("Was neues ausgeben"); - - //just some testing - /*C3PO Herbert = new C3PO(0, "Herbert"); - int[] input = {6,5,4,3,2,1}; - Herbert.triggerPowerSwitch(); - try{ - String asString = Herbert.speak(input); - System.out.println(asString); - }catch(RobotException re){ - System.out.println(re); - } - - */ +// +// */ } } diff --git a/domain/C3PO.java b/domain/C3PO.java index 339e645..90f49e0 100644 --- a/domain/C3PO.java +++ b/domain/C3PO.java @@ -4,9 +4,10 @@ import safety.robot_exceptions.ExceptionStorage; import safety.robot_exceptions.RobotException; import safety.robot_exceptions.robotExceptions; -public class C3PO extends RobotBasics { +public class C3PO extends Robot { public C3PO(int id, String name){ - super(id, name); + super(id, name, "C3PO"); + } /* public String ausgabe(int[] input) throws RobotException{ diff --git a/domain/Factory.java b/domain/Factory.java index 0cf6adb..4c6130f 100644 --- a/domain/Factory.java +++ b/domain/Factory.java @@ -1,9 +1,35 @@ package domain; +import java.io.Serializable; +import java.util.Collection; import java.util.HashMap; -public class Factory { - private HashMap robots = new HashMap<>(); +public class Factory implements Serializable { + private HashMap robots = new HashMap<>(); private int c3poID = 0; private int r2d2ID = 1000; -} + + public Factory(){ + + } + + //Has to return Collection + public Collection getRobotList(){ + return robots.values(); + } + + public boolean buildNewRobot(String name, int type){ + Robot r ; + if(type == 0){ + r = new R2D2(r2d2ID++, name); + }else if(type == 1){ + r = new C3PO(c3poID++, name); + }else{ + return false; + } + + robots.put(r.getId(), r); + return true; + } + } + diff --git a/domain/R2D2.java b/domain/R2D2.java index 9279b9e..035e4f3 100644 --- a/domain/R2D2.java +++ b/domain/R2D2.java @@ -5,14 +5,16 @@ import safety.robot_exceptions.ExceptionStorage; import safety.robot_exceptions.RobotException; import safety.robot_exceptions.robotExceptions; -public class R2D2 extends RobotBasics { +import java.io.Serializable; + +public class R2D2 extends Robot { /** * * @param id> int * @param name> String */ public R2D2(int id, String name){ - super(id, name); + super(id, name, "R2D2"); } diff --git a/domain/RobotBasics.java b/domain/Robot.java similarity index 93% rename from domain/RobotBasics.java rename to domain/Robot.java index 202c1ab..a85404e 100644 --- a/domain/RobotBasics.java +++ b/domain/Robot.java @@ -3,23 +3,26 @@ package domain; import safety.robot_exceptions.ExceptionStorage; import safety.robot_exceptions.RobotException; import safety.robot_exceptions.robotExceptions; -import safety.interfaces.Robot; +import java.io.Serializable; import java.util.Arrays; import java.util.stream.Collectors; -public abstract class RobotBasics implements Robot { +public abstract class Robot implements safety.interfaces.Robot, Serializable { protected ExceptionStorage exceptions; private int id; private String name; private boolean power; - public RobotBasics(int id, String name){ + private String type; + + public Robot(int id, String name, String type){ this.id = id; this.name = name; this.power = false; this.exceptions = null; + this.type = type; } /** @@ -168,5 +171,9 @@ public abstract class RobotBasics implements Robot { } + @Override + public String toString(){ + return "Name: " + name + "; ID: " + id + "; Type: " + type; + } } diff --git a/facade/FactorySystem.java b/facade/FactorySystem.java index f887e8d..6ec5f3e 100644 --- a/facade/FactorySystem.java +++ b/facade/FactorySystem.java @@ -1,19 +1,46 @@ package facade; +import java.util.Collection; import java.util.HashMap; import domain.*; import infrastructure.Persistenz; public class FactorySystem { + private Factory factory; + private String factoryName; - private String name; - - public FactorySystem(String name){ - if(Persistenz.existsSavedData(name)){ - + public FactorySystem(String factoryName){ + this.factoryName = factoryName; + if(Persistenz.existsSavedData(factoryName)){ + try{ + this.factory = (Factory) Persistenz.loadFactoryData(factoryName); + } catch (Exception e) { + System.out.println("Loading of old factory not possible"); + System.out.println(e.getCause()); + } + }else{ + this.factory = new Factory(); } } + public String[] getAllRobots(){ + Collection robots = factory.getRobotList(); + String[] list = new String[robots.size()]; + int i = 0; + for(Robot r: robots){ + list[i++] = r.toString(); + } + return list; + } + + public boolean buildNewRobot(String name, int type){ + boolean check = factory.buildNewRobot(name, type); + if(check) { + Persistenz.saveFactoryData(factory, factoryName); + } + return check; + } + } diff --git a/infrastructure/Persistenz.java b/infrastructure/Persistenz.java index 51e9b3f..c50b74c 100644 --- a/infrastructure/Persistenz.java +++ b/infrastructure/Persistenz.java @@ -8,17 +8,22 @@ public class Persistenz { return new File(name + FACTORY_DATA).exists(); } - public static void saveFactoryData(Object Factory, String name) throws Exception{ - ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(name + FACTORY_DATA)); - oos.writeObject(Factory); - oos.close(); + public static void saveFactoryData(Object Factory, String name){ + try{ + 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{ ObjectInputStream ois = new ObjectInputStream(new FileInputStream(name + FACTORY_DATA)); - Object Factory = ois.readObject(); + Object fac = ois.readObject(); ois.close(); - return Factory; + return fac; } } diff --git a/out/production/Robot_Factory_PR/Main.class b/out/production/Robot_Factory_PR/Main.class index 2afee343be3df3bb3cf463ff913afec6d310a1dc..27517b0d3feea1ca0a3063aed511bf2a506714a3 100644 GIT binary patch literal 574 zcmZuu+fKqj5ItKig<1hApm@d0L)FB70EQP65|g42C<*#tmQrvDv`J}A_$;4DB=H0M zDC2A~;icVlCNpQwnc3N&->+`~EnH|&kW!J>kwKQBG~plInsRS!Jq{+W6Eb9Pg(t!m zL(07DsmL)@M%>{;*J^Vo^n*orF%R8Y4jO|Vy7TajV42sTLYKPR3{}(KD0jm^c;lv2 zD>7svVLjh#C}2kx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1jX0Aa)c56uJARdutN6b1R8vP^(A{)(j;~k?zIM zc!#=zzW;>t+=Xc8HsdHWzT@~Fn=sw(gm3XKZ=>}2B5lkN>jL$UzY7Jgzy1ABsJ;6NBk+&c#3hifXhr;@?Yfv==uNv diff --git a/out/production/Robot_Factory_PR/README.md b/out/production/Robot_Factory_PR/README.md index 260ddad..43a3495 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-) -* ### [robot](#robot-1) - * ### [exceptions](#exceptions-1) +* ### [safety](#robot-1) + * ### [safety](#exceptions-1) * [RobotException](#-class-robotexception-) * [RobotIllegalStateException](#-class-robotillegalstateexception-) * [RobotMagicValueException](#-class-robotmagicvalueexception-) @@ -199,9 +199,9 @@ ___ `loadFactoryData():Object -> throws` -## robot +## safety -### exceptions +### safety

Class RobotException diff --git a/out/production/Robot_Factory_PR/domain/C3PO.class b/out/production/Robot_Factory_PR/domain/C3PO.class index a432459c71369ba963122c369754b1da7fce481b..21073388b0e4c9f56480673d0b91d0ea9f63889a 100644 GIT binary patch literal 1640 zcma)6T~iZD6g`~~CmALIQCO9r=&EFrXcYX|-MDDP$Yz}Y8cdb)V0FS6XMq`NGWhXR z`~~~!Zq-87TD89KkFq>H8B!on#luYZ?e2Tex#!;Q|G)nGAAngbClM1En44Kz)G>gB zh7$%fBn6CBZ$mn6>6zE^0)Z3v9M=hE1#-EX^@n^bOY73@lp2BWxSjIB6|<>B$Djto zKpGi=!6=@B5=c4SCGVZ>FS-KpocS_|VF6KAJ|hNB;k1Azx4IqKvK8dYA(-YtPz_@O zSG)4H9egPHiuf!0ecRp)9MA3cGO6y`I!1BEz*(FVNCsXn5rNaWL*k~8#e|0Q1}|)6bw0c)siqcnWz1To5Q64IFk#-?wZwQ>^AS1J_X!(CuB}DNFuH@_qLR zIuzojfoaSzM*EH3UaR=N{2-8EQ{<3VXb7jQx z+H$=qeMi~R;z01mVV-GgPt%tLV$LeNyvArQ>#2MX+$1K}-L&PJqC)zI9f^p~vb|Q9n-O)rUjinOU>+{H=nZenZ`+R@m2pa4;p>VyE>gq+ zJ|y6uGV(zYxKHZ|?KsC&e!Ms$b`bxIMhp-5*EwHL~ z%=5IsZ>Vupf&YvGPv^Ih`iPVH!pP7zPJXHvxADWL&lr92H^#YlaR-;{`OlboQQU#~ z4~oSvjH4lgA>N{R$mBe2@Bz>;&ebf2F~Pk_TxMD~a4BS$C*Cj;_?;=mxRZeu&cKe` zWju{K78rez(KN&sHH;>(L_=vZ%8xx3(Qk20r9Y7`Y~#j9>cjC?#QUd+_ZJ@MG0cS8 zO7UdxtjQ`2j+>2erBgd~Jzv_NKPabqk@uC6eI zG;7uPqM9o@gFltt3?j6jQBBW@`Wm7hjmQ|q7(-aSs4AsC)X3@ixnfSTSs9P;n4GISYIQefn*19> zfO?$X6#bu+F@%6i@J2Azm^1U)QHL-R#o9rEp@`xyxMs=3Kr)|@0 z7ATrdtr5Nr(@y->fy#HqVIazz416ZJ4m6hNT74O!PRqQ?QD{v+IHUsjwum88vUzp4 z$PZlRuxCi*0ZKq8h;Yd`G^^^OCQ=QF6E`l9X~u$du*IhdWQ}IJ&e5s>KYaly(>;0$ z_JbaMctKb39sp!AjL>TV=&zgM6<*Vd9FW621rbjRcth3k{F_CN;-5I(rcr%mhhGclH^}-o`}FBp1?c2r|62q>|2o#51>d3QIR

VS&0%`~-X=8|y26HZ(ej$9F5p&Wcz{SP+3Ng4nE diff --git a/out/production/Robot_Factory_PR/domain/C3POTest.class b/out/production/Robot_Factory_PR/domain/C3POTest.class index 81076ce71d17d5842a126d93a44906042d1fb186..ec5b81cee3de5f5cec303f36405020122a95ee9e 100644 GIT binary patch delta 48 rcmaDS{YQF35fh(Uabj9(Nu_>Keo}r({N_p~ViT>sWCSxWJMIQ)nas!j(=G!caoB$1z4Bh|$ diff --git a/out/production/Robot_Factory_PR/domain/Factory.class b/out/production/Robot_Factory_PR/domain/Factory.class new file mode 100644 index 0000000000000000000000000000000000000000..41206cd5ae40d9ebb211b2e3bed3ddb0be92bca3 GIT binary patch literal 1308 zcmZ`&+fvg|6kVq&24cX12nZFyYpIuNQ2~SX0-_l!IM%_zC(}08U`Uvd>gcEV)wLeQNi@z|xTw*q=ywSez{y7{aiu_NYK#&fY<(f-7<4 z1r19UIrY6(E6`E#8i5lxBc89cbTGNs>6QeEcB|Z4xK*+Q(lcS5_yc7xaOayVRX2LH z!`@R4YmUF@Fe9@i#&rDL|Kh1Xa8{_lXD^1n`1LA%ot4*|!+{f}y4S(gu2;q@PmbnQa`I ze~-~@`knNRC|^eTGV~pzuT5K*0?uvW_$Q2UD?CoGlTK4ohB^E|KNAeFq{A4Y{0Wvb zg`=?fCnc6BV1V&AaFgq$KPO5`WXsbn%&4;NVU`U~5!sUa2`*X*(ZY8b5{K zLQRB35`FK7GM<*vfZGy$(e~bxd;aHl{`cPg{`2D}fCa215MhX|&n?f1h#@ZEj06D* z25H;g<))Qew=1^CaAw}LOmBffmW%ou{+8$J+^XeDo?}|Ie0xMGixANxK$4I`FGJ6f z9+hH9n(lM^o#8yQ7^1TB!e4w=!Z~CZQm#=qs-9_ECEM{!%UeZdt0xCzadTC>Eqrjl(r_9Xz z4Gc*b#t4H@GrTpvYcTZ7O1m{8`Y`6ZJkGEnpSnW3kWvkS zUwD#Xx_jYZ$HUybQchBDvIGSxgJ>LiOm3-N;luP+>3jkj0}E`Lm5{?VvWYj{8n2K| zGVO4O_S!=X*-pn#DbpEVvbRYpt(%sy*4(Wa&IYg4DU#9cDzBHhWBT(}Fy_5BsezP! z>{R9%BIY(x7D>$t_Ak>3Ax^p04nuEndO|;_jjne5V<|)2v>Hu1+mS6QmMVF?y0gj~ zEjTfBj}YT-!{Agc>)(P-IAY0eI#pxE^qWokH+j~-pBSfIi_s+qq9C(zo!)aadrHwL zeUs{-mSOvdex*qSH|Qs<3YfuhCC|$!5$LBqd` z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576@ivDwzvZgwkemIYx~=!#*Z&%h*#+9mvOv`*HpYN7uOqH|7)&-oP2eEmmOQB z{>}eC*+H7Kq2dIabZ%{spw6#q{K}m{^*&0i@)1Z$KO^4*n$SSYD9vktqise=lNup?+8yr=N(;o2?*~b zQ;-SHAs+)gqFmlUPZ1S*PM}0~mW(hayWg>wBy-*pg2?q)IP{?s2$jYFOf=H9X%ob4CAitLN z;Esgc#H!#Hu`@7!j91A_J@ZT4Li>7rLm~V6sy)Agh)d%83lox+I-b6J70L8i&)tD& zpOR2Iui>Gdgwop=OT?N}ze6l~V?`0y@BLG`@e#Ua-pB6LEj)4?>9N#D*gn&98@;T5 z&!6eaXJik%417n&aGJ%P;5+j)l9*yurum6=79)7dOD)9&+Swu|`!B{Pjkw_T8B+?< zm8T*~gem!Jg7O(QtFVM<`xr3+n?gxw7yp;>On~cs%4A7KQt4YbcolooAK>vj$O0eY zs}c0vVFLI7xeqZOAqi*R^HH4*P@VKp9q>^dSdXeeY>Q}N&K=D55uTIG@Gx^6hE+v% zIKUE>X;iU{1X!fZ@fuyCib5psLsEeoAo+wiVpKUFAn8~7JJNTr;ZTP%KalR|?Nd76 zMti!mH=(?XmUO4`bh>jTdarl<`n`Y2yM!{n5@F^3kzR-Ke^suRqX=9f#%Gz|x7o|z zVTGP!M}HSbD0>3WV+b#>o-eY6Ry@1|Y@#;o$18b~B|X-X$GmE8R)yc)COK5+yHx{i3`Ku=jvpke64<%WGV2uX7CFVC{c}G|va|7SXz!KhIGL6_#rb!GWGqU%HO3aI zj4gy1>q6b9az)>xeoRHZHx=9lTmFsMCrE?|jIxMwZ9c~$%Do)H_ZZ@bcnLozBtZyo OQZCp1RYLd;+W!k4wZDh} diff --git a/out/production/Robot_Factory_PR/facade/Factory.class b/out/production/Robot_Factory_PR/facade/Factory.class deleted file mode 100644 index fe3da3e7e3c937fca03bab067457a9940a276c77..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 517 zcmZWm%TB^T6g|@-rM2=FAK+`JUDyPd5Eg2PBvlhJBrb=x!jRIE(wg{LE(nPxet=)% zR~TktFJ7dCpK|H79?7>Opz7?h8?OT?9w5->7D#hCd0`uP~4+xKnzB? zVJyLn4=7Jds0(O@yg<yC Ezq9UYO8@`> diff --git a/out/production/Robot_Factory_PR/facade/FactorySystem.class b/out/production/Robot_Factory_PR/facade/FactorySystem.class new file mode 100644 index 0000000000000000000000000000000000000000..2e404a221497b20eec35cb4790ae0fd4d29ae809 GIT binary patch literal 2070 zcmZ`)TUQ%Z7~Llc420nxN>dt0ONAsLX%TNgDJ?CEhKmiNrQRmV00WauoJ_dXSN{aR zfEORsWz$xdu0Fc_4=(?Q%O&nJnE-*hSj?O==Y0Fy`@7|je}DcBzzp_-@WHPjprQed z0v+4hu9h^l!e(+gv#nP5$}3eAY(nu6;p263Y zQ>9~A$rZ-PVWe~|Kh=aGfx#5@Fm6$6BWjtssK+8&u$*YoDwT|ksRt25TtPy`2u5p6 z>cPmrD51^5{{(R@hzQ11Bym%qX;XLRv~r0V?2X0G#AM_CZ{r;Sm8cJ`jOC=5Re{Sj4c1=B4eYr~ z0)dk8g#1{U3kqiIgX>nBgt@0;4)-a@aCBQ^T?$;PbGzVur_*`7r{H}R3;2MAd+M}y zg(2M1N=y1axzp>qv`DE~#1hFA+|QvJ_L(lCk`-$AO2*Y6#4;YLNMn`E9IM(G6k2C} z(k{JNQ}GEt6==pc zSvf|yJ!KU1rE)%_+p9A5va7AEX0BYmP@dXjbIOl;@1UOxr z(azIOp7-!Z7Y5LcVT5pt`w6!A9bCbeyd9B%1H%ZQ|CPJ zH(d$Y&wNU$-w+_ccb}9xaqx(1Tt%Rjn}}%@+D3rOl{Y@yjakfDc<$f==4H(Ip%%q4 z(`s3|%&f7h;7PCP$)4$KT!Til3MpJiKl2S%8g9ZMHW6bSV5f&!F`L;kR4JkiGKR-& z;x?mG!FMpks*3yHV`o54%$B}$Zu~!P4eoPf$bEo^A(!|A)pX{J492|uFEDbYNY_I% zGCT>DQk)AUkc3No5guxJT8$ReMe1qtl2jeWNVHrAqj$f(h;tx}T&U4LRNmpE=xXD$;w3Y34Y4&-g7=BhS(%T*3<0(C`;3kxo7U delta 608 zcmYjOOHUI~7(I8U!@xL<5iOylDb+f>3KS@UiVBLL)gmZbt-@kLW>Fq9wJiq1!npAd z+^s)=C2Sx-!pfD2f&Zg1o*A3i#l7F-p6{G<@BM9^TgHz+Cuaa2VCBHr5%Qaei*9)= z;-fY!11a>G(9kc?(VJg$J~^3^pUHXUt=dwp;yRm?eT4utU}6wMQdhcLQn;>TL?9-A zDlxgBjEiykRk@J6YL_giwq?w2ue#-0$@i){p2#nvUGAxlj7PH8qJfuqrDMs&CA^j^ zk?(dvz!Y=NYR#|g3{~9<%be%Am6;8vT6M`#6tLw-En(cu`~Lb?S;q(IX@jX@D7=+G zCq|KF9Al;679z|wG;yDhXIgvDZT5o-?B3yS*7LiVWYvOuxF2GFX*aU}vCR$GD}1|b zh@HYTH71ys$fh!O$;GC`=L2R6g6THu2O3ed(wT(>E{9CXe`q|!Bc5|EN?3&q>87oi~T1&#}Rst(3?*mB0Zlz+(u?#pW}@d+DLts7Ov4k uw828MewiqL;2EA%u#?Xd*lM((A|LY2;{{_gQ43se@RpUq>>b`?8L_`T>sUho diff --git a/out/production/Robot_Factory_PR/robot/exceptions/ArrayEmptyException.class b/out/production/Robot_Factory_PR/robot/exceptions/ArrayEmptyException.class deleted file mode 100644 index a22a604d16f011c2eaa0331d4beb2c0721247811..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 489 zcmZuu%SyvQ6g`v1Mq{+T7Vdl?;tR8M5h;jN5TXk!-B02WN777~OvQYbE5U^y;75sf zqIO|A7cTc)&bhDo{CfWY(8q=k2OSS?fH`y-wzNu=3B^k)N+VTKg?BbF_`?j{b6H5! zXE-~ETjVA&C09}W#GiSX^CAm}M$00L4o4p58TMMz3$1xQ7?-A=>KWWi^&l8}u`I;x zWSj_n&y$=oYq3gsKH^$h{F`*mqpTSA+jGq*9#M5umsD%F&Huj#Lm;$P`bJb0&zk?GI~_RMk`n)HXVqNgY|C>i-G|F diff --git a/out/production/Robot_Factory_PR/robot/exceptions/RobotIllegalStateException.class b/out/production/Robot_Factory_PR/robot/exceptions/RobotIllegalStateException.class deleted file mode 100644 index e7988e5565896a0512efc4de7fd2f71806ca4047..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 510 zcmZ`$Jx{|h5PeQV10hhp_5u@7Xhw#hE(oMb5d%TponQqcH?ABP!OvnsV&DhxqY&o+ z9f<0aPWMjl-G}e<>-_`32zwzsbOQJhR?ubW8=Y$#i|0bjtkhK<-@3%rA7ULobz; zxS3CLVeWXYD6^C5f~yHP(&68vZy#jMaMm7gd5?se*q0fVJZ#JUZ^aM^W3-uyy5?mw zMr%)oFw=8Wh->Kv?JsXVbXpuBpi8*N$mka2*9eW#Ap?Sw!RZ^=D}^3H^6qdTT9<_D c6z%`e5MhH539yMC6>-rPwuw#OMaaYMH`G;%Q2+n{ diff --git a/out/production/Robot_Factory_PR/robot/exceptions/RobotMagicValueException.class b/out/production/Robot_Factory_PR/robot/exceptions/RobotMagicValueException.class deleted file mode 100644 index 3bc7be972e1cf19c56670fc25353242d98b8e2c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 504 zcmZ`$O-sW-5Ph4*L}RpmUB!=+wbC3tM0ybgA$qWq`z9`NCC!%2M)YTS5*c~wLcqh(dZgVe_|!=NK=`&{!v<|!{5F)za4o~wJo&`)F~ zZklN(^c~Mi%4{Vn=Vi*ZwD>pang>}k47JU>4^D?7?hh5SCjTl0qwbD~j*Su(l z={G|L6{mi_Q)S|S+DE*1@O;av>A%CSS}uhokxD&2TXh+Ob>@t4EEi)q-1rTLa$}=@NVB(uuB{V0cZpew zoot(_I$pkNeu~!1$BC@{&dI;zPtHG)xb#Z@95i3qN|Frz*Enr5bqHc1)qzY}W$2)3 Ymt!|!7rlgg*iU$XLs1frR diff --git a/out/production/Robot_Factory_PR/robot/interfaces/RobotInstructions.class b/out/production/Robot_Factory_PR/robot/interfaces/RobotInstructions.class deleted file mode 100644 index ab7d6de015d489474a85c4ff5cc05b7ae258f28e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 268 zcmZXPO$x#=5QSgVwpxF1wK2h3ByX8W75@Kx%E96|| ml8pYMjZ4>%fuTx20ToIbAf!2>sYbOtY#91bnc`FSNp`8n(i9E=RgIMjIN6_*s1CYNO9=M^(Da0Ta= o7A2>;W#*&;IbeJBKvn`RVPs%tU}9ipUt<8 literal 0 HcmV?d00001 diff --git a/out/production/Robot_Factory_PR/safety/interfaces/RobotControl.class b/out/production/Robot_Factory_PR/safety/interfaces/RobotControl.class new file mode 100644 index 0000000000000000000000000000000000000000..bf76523e4a4bd0f96d27c843be4faa5ca388a6bf GIT binary patch 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 literal 0 HcmV?d00001 diff --git a/out/production/Robot_Factory_PR/safety/interfaces/RobotInstructions.class b/out/production/Robot_Factory_PR/safety/interfaces/RobotInstructions.class new file mode 100644 index 0000000000000000000000000000000000000000..78060e1e88272a6b2cbb656a57e6d13c05a25c40 GIT binary patch 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 literal 0 HcmV?d00001 diff --git a/out/production/Robot_Factory_PR/robot/exceptions/ExceptionStorage.class b/out/production/Robot_Factory_PR/safety/robot_exceptions/ExceptionStorage.class similarity index 52% rename from out/production/Robot_Factory_PR/robot/exceptions/ExceptionStorage.class rename to out/production/Robot_Factory_PR/safety/robot_exceptions/ExceptionStorage.class index 5f07ef76f67140c983a4c0a192d105602c7b90f1..d64342727f6d8c6696a54ca2788a7bed34735704 100644 GIT binary patch delta 117 zcmeC+Sj{oPgHNM4F)g*EQokraDZeCsqQ5%7h7XF+#yT}d0c|wFiFHzwk26~GYoV&0 Y=r284nJHdSOG6V)qE2e_GNvR(0DvVaGynhq delta 81 zcmZ3@(ZMmngI%#GKPkUNe`1(AhoTRJJ$XHo)W&5zjGQVONFtN(Fj{gb!vs{As<@Oj MG@;zh>zQg80X3BxF8}}l diff --git a/out/production/Robot_Factory_PR/robot/exceptions/RobotException.class b/out/production/Robot_Factory_PR/safety/robot_exceptions/RobotException.class similarity index 55% rename from out/production/Robot_Factory_PR/robot/exceptions/RobotException.class rename to out/production/Robot_Factory_PR/safety/robot_exceptions/RobotException.class index 89c40549b5996698969927225fe23d09ea6fe360..c3c0717b5e6ab88061d30bedf8ec024170b1bf8a 100644 GIT binary patch delta 137 zcmX@g^`2{jB%fMwVp?iRrG8Ov$=Z0X6qjQs2hFe$0YEsPbM W<_NWVldYI6I257kH#ai9V*&sMj~~PU diff --git a/out/production/Robot_Factory_PR/safety/robot_exceptions/RobotIllegalStateException.class b/out/production/Robot_Factory_PR/safety/robot_exceptions/RobotIllegalStateException.class new file mode 100644 index 0000000000000000000000000000000000000000..207e044fe25f8aabdb465d32a28977618a9ab145 GIT binary patch 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 literal 0 HcmV?d00001 diff --git a/out/production/Robot_Factory_PR/safety/robot_exceptions/RobotMagicValueException.class b/out/production/Robot_Factory_PR/safety/robot_exceptions/RobotMagicValueException.class new file mode 100644 index 0000000000000000000000000000000000000000..4d7d141da70251cea933f68a4a81b6abfc72dbe6 GIT binary patch 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 literal 0 HcmV?d00001 diff --git a/out/production/Robot_Factory_PR/robot/exceptions/robotExceptions.class b/out/production/Robot_Factory_PR/safety/robot_exceptions/robotExceptions.class similarity index 57% rename from out/production/Robot_Factory_PR/robot/exceptions/robotExceptions.class rename to out/production/Robot_Factory_PR/safety/robot_exceptions/robotExceptions.class index 577d7f19f2dd7753d3c8cf37bab306dd541bbad8..f8480197e869b26374eba7ad72a974b9adfa7b84 100644 GIT binary patch delta 197 zcmbQoeS%x|)W2Q(7#JAr7+l#Im>3z3xpit>~4OY|ouN=-DE=1}s1apO6aqv0Isjju}> zxm7hZVM3D&nd}+OCU0aCWrJt{3dm0Wz|E0cy`y!ZU}nm8EVM-)VL z#2W>V=_NVvyqVWah8$R(3148&I3^vUwT10y72-Fyh*u0e01+ViDRna;&xJfU;p)`O z!{hwnQxr-W35OALd{f7aXmaW|nPUdt>Y5Y*Qr&6U)3PFeVh(YwobC#0QJ(#{y&Ilg zE-Q%WP&>qF(|{vAIy&0hZnx@`U-WMllGpE73NUg9DVCgkyk6Md8Dy-*^YXVAa*ou5 z?1fJzYlF@BO3_iE>QHQRAF9W?lp9FUpg}!hGgk(&WccKWik>z~ruL7tjo+=R43=25 qXdvd278S^j!wY?CRl#l73YqA6^aQ6!j-A32P%D(zZGl+mHTVIMAc$lD literal 0 HcmV?d00001 diff --git a/out/production/Robot_Factory_PR/ui/UI.class b/out/production/Robot_Factory_PR/ui/UI.class index 51a0402d2809d9733bbd9c509870fbeab82d6c8a..0cda82e92cbb542ccfa27665cffd283674cd62d5 100644 GIT binary patch literal 3459 zcmai0`*Ryt75=U)d1ZNHCwA=EjgxHBB(?lfVz)_a$1bs)ho~L9k>ik`+q;a17HlB2}Dq*A*v&WdV!tS%vCd0H0`C-^ujfn^91ToS+?bk3Dk8b=QP9x zcKJdT&nl*}In%afxd90@YS4A;K+^+OvKy`^R|F!KEzmaUYg$e!W0xvk)+cbzRmw6oBg?ME@a?Y(G|P2P-K@DP^Ao0L5{xj^YJm9?Z%Fc+k4EIP#{Y3HTk_`XYfIF1RDr~i1r;TD`V!z>n!va{fLuF=n5 z9B0+;V85|Yv5I-amTSRwxO-mh4)q&yrQ~h+&y-g1i{p!G_wjz?%(~@$YLk{HiH0#| zC}%I|m{$13{NNO=pVe^@S%J7M*S$&0CXIG?C#w>6pGcR$+PbXcOSp2czx9 zGEJ1svMag#jQnI2ljn7OS%JQzNV1(S7BBi3sGa9^yx{Nn2waeB{#G0$Vq?W9m8I*- zyg{T{Pn}-Dat;1X+pz3avuNc*q%|;t1KaeuP+3`!<+DzC#q{n|DUKz2a8J=vl^%!1 z2+lc9-WcDIifhX{ieO*Rm*lpiDzxPM!|=r62<)3JNLQ-7d5&xN4Y-4@C~IKoOR;;Vk-dpDf0Ld^(Pb!2ZhxD_1bQ zjgl`AY~~%KVyv0AN0~Ls81u)TBNNNU#leX|LX|h>j|UIZLo?GV#tnrzYrnll)n<}c zTiAhL((!eCLtxK}xh&I;oin}5mRI1+^>`G${(mJOGN=UtFU9e)z@w+_A}M1VdFdK{ zmf41kMOk3YxVb{n6)Emofv2x%6h-VQ28lW@$=#1t;$|*W-EuH}Fdh@2G_Q zie%X)IhpJ%%Txe#kfX3E3tX>GZ73KRJx@jyrF(eNah5Bkk*eszj8#2(Kyj9?*ATA` zHEi?MjU+UYCb_egCr9FVS70E`7p%v+Rt?Xmg3otFYoD}hq}p~Vh&X=xxjKs1#;0^x z!5Q@hkS?0+Ag+e@1&%y~T`fp7{GL_x`J(*#2=K!}_OJ*GrjB>M)H#dr*&&WlUj)3z zSOGD7oA>W<^&+Cad{@tHh@QVdyYc}VZln1_wDk0Th>o5ublsv{1h4oOV!Ss~rwJ|C zNqf6^Mk~JS@2PXU@G4&8sAlSXl2N@Z!_#h4vyOYCwNE?H`wT9meDOdt;W;g zm=4D?;dm|_GvWBm7N&asjFv6Te1zFkd;dst80IB-MS1P#b%a+RuanHd)lC>2p4&vH zI_E{&*+kPO9#N|WwYuv~s`;WnFQ{pO(_8d(3@_tNJGLI6m z$9QTtXGshY(G&c(8Y6NUt_noY!Evl&khX?s=?U5zrnM*WW4_R@bN&uS@jf*a6%6Jj zgEZctl%PZ$Kg5sx*lvcHE2LY|fPeEHSYMxr{0rK+hP(orFJ_7=Zhpd5J;yYm>e#}y z$=*Bf;+P7}W@x=reRsy{PDIHC84-- zh~5CFc^~ITc$z3oFyb?eZh}#q=hJ8I$B?Ado77OGPlukzF~W%6qKhhqPDJmLSTUb1 zZ)ZXosZ}EWa5peMG*+9aYo;A}5FgaDlN-v!rKOH_tMI z7s-Vz^FGUXFX0^K$e=55G0)cVJYHwxxR+^$6=KuDebsCPb!PArWff$?3=9l*3<49mOxRdUGxb9~C(E!oW^e`Pmlh?bx@G31GBU7-dg^5* zmL)PMGO#l+0o5}wFajYf0~?U!1oHI3dI?*IS* diff --git a/test_factoryFactory.ser b/test_factoryFactory.ser new file mode 100644 index 0000000000000000000000000000000000000000..3648c0ee63bb598e2cc7d3efc4f031f7b7080f0d GIT binary patch literal 471 zcmYL_ze~eF6vtoErfO59t>ES?I3&<6N(TjNX(ax@ZaUO!bEc6rcV4b-x(I^k;HtZW zlk}eu$4=rVg5u=jTu1NHs>2-*K3~4?`@VxO&_V{Y4rwDVFe<3Y3F|+R_P#bf|kIR!e%^GK3;7Z2(6raE;=;Ne7IcQbP8XkwF%o<9liAI!olKm)uB9SB( FML)ihkD~wp literal 0 HcmV?d00001 diff --git a/ui/UI.java b/ui/UI.java index a0a5271..6317070 100644 --- a/ui/UI.java +++ b/ui/UI.java @@ -1,18 +1,19 @@ package ui; -import facade.Factory; +import facade.FactorySystem; import infrastructure.Persistenz; +import java.sql.SQLOutput; import java.util.Scanner; public class UI { - private Factory factory; + private FactorySystem fs; private String name; Scanner sc = new Scanner(System.in); - public UI (Factory factory){ - this.factory = factory; + public UI (FactorySystem fs){ + this.fs = fs; hauptmenü(); } @@ -20,16 +21,77 @@ public class UI { this.name = name; if(Persistenz.existsSavedData(name)){ try{ - this.factory = (Factory) Persistenz.loadFactoryData(name); + this.fs = (FactorySystem) Persistenz.loadFactoryData(name); }catch(Exception e){ } }else{ - this.factory = new Factory(); + this.fs = new FactorySystem(name); } } - public void hauptmenü(){ + private void hauptmenü() { + mainloop: + while(true){ + 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.print(" > "); + try{ + int input = Integer.parseInt(sc.nextLine()); + switch(input){ + case 1: + listAllRobots();break; + case 2: buildNewRobot();break; + case 3: System.out.println("u pressed 3");break; + case 4: break mainloop; + default: + System.out.println("this is an invalid option"); break; + } + + }catch(NumberFormatException e){ + System.out.println("invalid input"); + } + } + + System.out.println("Good Bye"); + } + + private void listAllRobots(){ + String[] listOfAll = fs.getAllRobots(); + if(listOfAll.length > 0){ + System.out.println("These robtos exist right now:"); + for (String s: listOfAll) { + System.out.println(s); + } + }else{ + System.out.println("There are no robots yet."); + } } + + private void buildNewRobot(){ + System.out.println("What shall the name of the robot be?"); + System.out.print(" > "); + String name = sc.nextLine(); + System.out.println("Which type of robot do u want?"); + System.out.println(" [0] for R2D2 and [1] for C3PO"); + System.out.print(" > "); + int type = Integer.parseInt(sc.nextLine()); + if(fs.buildNewRobot(name, type)){ + switch(type){ + case 0: + //Created new Robot of type R2D2 with the name + System.out.println("Created new Robot of type R2D2 with the name " + name );break; + case 1: + System.out.println("Created new Robot of type C3PO with the name " + name );break; + } + }else{ + System.out.println("Anlegen des Roboters fehlgeschlagen"); + } + } }