From 0f217e8d6c338fa2bce3baff0b8e1a628f4954f3 Mon Sep 17 00:00:00 2001 From: Philipp3107 Date: Mon, 2 Jan 2023 19:51:04 +0100 Subject: [PATCH] Updated everything. Further explanation in README --- .DS_Store | Bin 0 -> 8196 bytes Main.java | 4 ++- README.md | 8 ++--- domain/C3PO.java | 9 ++---- domain/C3POTest.java | 2 +- domain/Factory.java | 9 ++++++ domain/R2D2.java | 10 +++---- domain/RobotBasics.java | 18 +++++------ facade/Factory.java | 5 ---- facade/FactorySystem.java | 19 ++++++++++++ .../Robot_Factory_PR/classpath.index | Bin 280 -> 0 bytes .../Robot_Factory_PR/domain/C3PO.class | Bin 1355 -> 1535 bytes .../Robot_Factory_PR/facade/Factory.class | Bin 260 -> 517 bytes out/production/Robot_Factory_PR/makefile | 6 +++- .../robot/exceptions/RobotException$1.class | Bin 802 -> 0 bytes .../robot/exceptions/RobotException.class | Bin 1734 -> 1349 bytes .../robot/exceptions/robotExceptions.class | Bin 1135 -> 1438 bytes robot/exceptions/robotExceptions.java | 5 ---- {robot => safety}/interfaces/Robot.java | 4 +-- .../interfaces/RobotControl.java | 4 +-- .../interfaces/RobotInstructions.java | 8 ++--- .../ArrayEmptyException.java | 2 +- .../robot_exceptions}/ExceptionStorage.java | 2 +- .../robot_exceptions}/RobotException.java | 10 ++----- .../RobotIllegalStateException.java | 2 +- .../RobotMagicValueException.java | 2 +- safety/robot_exceptions/robotExceptions.java | 17 +++++++++++ ui/UI.java | 28 ++++++++++++++++++ 28 files changed, 116 insertions(+), 58 deletions(-) create mode 100644 .DS_Store create mode 100644 domain/Factory.java delete mode 100644 facade/Factory.java create mode 100644 facade/FactorySystem.java delete mode 100644 out/production/Robot_Factory_PR/classpath.index delete mode 100644 out/production/Robot_Factory_PR/robot/exceptions/RobotException$1.class delete mode 100644 robot/exceptions/robotExceptions.java rename {robot => safety}/interfaces/Robot.java (73%) rename {robot => safety}/interfaces/RobotControl.java (97%) rename {robot => safety}/interfaces/RobotInstructions.java (91%) rename {robot/exceptions => safety/robot_exceptions}/ArrayEmptyException.java (84%) rename {robot/exceptions => safety/robot_exceptions}/ExceptionStorage.java (96%) rename {robot/exceptions => safety/robot_exceptions}/RobotException.java (56%) rename {robot/exceptions => safety/robot_exceptions}/RobotIllegalStateException.java (85%) rename {robot/exceptions => safety/robot_exceptions}/RobotMagicValueException.java (84%) create mode 100644 safety/robot_exceptions/robotExceptions.java diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..4b5e2a64c27d95c1057952c2a6eff6d07b975b57 GIT binary patch literal 8196 zcmeHMJxd%>6uobD4GV%;+5{#bF*fT*9mqsRi|vAS!2K|~vXha`Zk^Yq4dfRD#1L3g zq))Igy+0vMy0n(Ep7-JA-PzGtg^2gTduM$2-Z^K^Jm)zh5vh$~XN_oqh-&Bt=VvjL zG!r*{szrV#1}fB3Z*Oh8oo9zrnKB^`hy&t)I3Ny)1OJNy*t1QmU9<1IsEp!(IB+i= zFwch=-C*KTJG74u4E7ZOSjDt$IG#5Lz}RErQ9DEgO}SE_D^>m#L%DLy$38Fds2#d; zQvT&bd1mF`P?TlI`D2?-Dsd>II3Ny8I}l^4N_EVgc$AK6b755S#MMop-A%@k1GJWg0V)Ig-49XN(UPN throws` -## robot +## safety -### exceptions +### safety

Class RobotException diff --git a/domain/C3PO.java b/domain/C3PO.java index 5eaa36b..339e645 100644 --- a/domain/C3PO.java +++ b/domain/C3PO.java @@ -1,11 +1,8 @@ package domain; -import robot.exceptions.ExceptionStorage; -import robot.exceptions.RobotException; -import robot.exceptions.robotExceptions; - -import java.util.Arrays; -import java.util.stream.Collectors; +import safety.robot_exceptions.ExceptionStorage; +import safety.robot_exceptions.RobotException; +import safety.robot_exceptions.robotExceptions; public class C3PO extends RobotBasics { public C3PO(int id, String name){ diff --git a/domain/C3POTest.java b/domain/C3POTest.java index d7bdeb9..f323dd8 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 robot.exceptions.RobotException; +import safety.robot_exceptions.RobotException; import static org.junit.jupiter.api.Assertions.*; diff --git a/domain/Factory.java b/domain/Factory.java new file mode 100644 index 0000000..0cf6adb --- /dev/null +++ b/domain/Factory.java @@ -0,0 +1,9 @@ +package domain; + +import java.util.HashMap; + +public class Factory { + private HashMap robots = new HashMap<>(); + private int c3poID = 0; + private int r2d2ID = 1000; +} diff --git a/domain/R2D2.java b/domain/R2D2.java index b7f6441..9279b9e 100644 --- a/domain/R2D2.java +++ b/domain/R2D2.java @@ -1,9 +1,9 @@ package domain; -import robot.exceptions.ExceptionStorage; -import robot.exceptions.RobotException; -import robot.exceptions.robotExceptions; +import safety.robot_exceptions.ExceptionStorage; +import safety.robot_exceptions.RobotException; +import safety.robot_exceptions.robotExceptions; public class R2D2 extends RobotBasics { /** @@ -18,7 +18,7 @@ public class R2D2 extends RobotBasics { /** - * @see robot.interfaces.RobotInstructions + * @see safety.interfaces.RobotInstructions */ public int[] think(int[] input) throws RobotException { if(isPowerOn()){ @@ -32,7 +32,7 @@ public class R2D2 extends RobotBasics { /** - * @see robot.interfaces.RobotInstructions + * @see safety.interfaces.RobotInstructions */ @Override public String speak(int[] input) throws RobotException { diff --git a/domain/RobotBasics.java b/domain/RobotBasics.java index 7596435..202c1ab 100644 --- a/domain/RobotBasics.java +++ b/domain/RobotBasics.java @@ -1,9 +1,9 @@ package domain; -import robot.exceptions.ExceptionStorage; -import robot.exceptions.RobotException; -import robot.exceptions.robotExceptions; -import robot.interfaces.Robot; +import safety.robot_exceptions.ExceptionStorage; +import safety.robot_exceptions.RobotException; +import safety.robot_exceptions.robotExceptions; +import safety.interfaces.Robot; import java.util.Arrays; import java.util.stream.Collectors; @@ -23,7 +23,7 @@ public abstract class RobotBasics implements Robot { } /** - * @see robot.interfaces.RobotControl; + * @see safety.interfaces.RobotControl; */ @Override public int getId() { @@ -31,7 +31,7 @@ public abstract class RobotBasics implements Robot { } /** - * @see robot.interfaces.RobotControl; + * @see safety.interfaces.RobotControl; */ @Override public String getName() { @@ -39,7 +39,7 @@ public abstract class RobotBasics implements Robot { } /** - * @see robot.interfaces.RobotControl; + * @see safety.interfaces.RobotControl; */ @Override public void triggerPowerSwitch() { @@ -51,7 +51,7 @@ public abstract class RobotBasics implements Robot { } /** - * @see robot.interfaces.RobotControl; + * @see safety.interfaces.RobotControl; */ @Override public boolean isPowerOn() { @@ -59,7 +59,7 @@ public abstract class RobotBasics implements Robot { } /** - * @see robot.interfaces.RobotControl; + * @see safety.interfaces.RobotControl; */ @Override public RobotException getLastException() { diff --git a/facade/Factory.java b/facade/Factory.java deleted file mode 100644 index b990d22..0000000 --- a/facade/Factory.java +++ /dev/null @@ -1,5 +0,0 @@ -package facade; - -public class Factory { - -} diff --git a/facade/FactorySystem.java b/facade/FactorySystem.java new file mode 100644 index 0000000..f887e8d --- /dev/null +++ b/facade/FactorySystem.java @@ -0,0 +1,19 @@ +package facade; + +import java.util.HashMap; +import domain.*; +import infrastructure.Persistenz; + +public class FactorySystem { + + + private String name; + + public FactorySystem(String name){ + if(Persistenz.existsSavedData(name)){ + + } + + } + +} diff --git a/out/production/Robot_Factory_PR/classpath.index b/out/production/Robot_Factory_PR/classpath.index deleted file mode 100644 index 03ee4a3855c10951daf3729ef9b8887947e5019c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 280 zcmb1OU}s=pU9a_;So(!g@5Bt>`0M>=a$RlS-|ji^Ps>0{jA_Y!-BKC3{i`1M z-FD;-glgdPU|`Vw2-D3e0bo3I$0-OzEJPHg9e4ky;q~C0 X6ObJNR4TFW1p@=)0tN<6^UQw$zwu2# diff --git a/out/production/Robot_Factory_PR/domain/C3PO.class b/out/production/Robot_Factory_PR/domain/C3PO.class index 241c8f0756fd161b4ded7a233dd92c8ee2e27888..a432459c71369ba963122c369754b1da7fce481b 100644 GIT binary patch delta 740 zcmaixO-~bH5XXPd*0!>47m`M!u`NQ2wo9>6si@#fg^HC{FhmmcVre!?Ojxt@pr?L_ zJ^2Z|`Vt|LL_B!X#INEvP-h=X#e?xOGdnvozyHkh&HQ!D{QC3bC*V5w-a?LO~pc$-_L+CjL|@%+{k*JO;mMU;Xfmk+)hBi+L407n_OC^Dfi|1>MI zjsFguF{Qa=ae+x`Za;O~&#J!PdZ~!!AJq#F!`~Mzrl=?q8=G6M9|~LX{Ei|PRs^;Y zOHW%|CL;ry)rI=pYPIp87B*hBn4uC(8lMMkt)#zB@WXhlW`pI($;E4O1rtN8MT~@8 z1kMl<8|MZ$#fMRqTPPjPF)!7M8n?yIO71mBbbUE^AIWx`&MsqX#U0Llz$xxYWgMG9 zl2Q}0GV%?l#ik{jVTfUlGfIxETp_3Vj!YbqD=%j=tyO=a$~DAOBSm9Z2j z8Kp@V=~Y5g;qEyisMOgrP-oPWhY=*w?*Nv^%)lC#b54x@WgurJZp>p0=F3VK3I zIKIrgLZRoH^&4`SbiJ%J=VU4?q#sw(=<`3MP?Iv5cf~Ck7{U6=`IQ zCovpeRk4PM0Oh+w#h3VDJWJQNoAjzd;s?n3T&4@5&8dhjjtVQ_ z!30!na~2)QkVBp;9>5L?5UklQ_NW%Hj{{cI_7N^iA2;f*#YUfdGJKeZ#;)lefScni zyCHVN@FRj5EI3Ji?iX=rF~ptBIF3-F*RhoktFJ7dCpK|H79?7>Opz7?h8?OT?9w5->7D#hCd0`uP~4+xKnzB? zVJyLn4=7Jds0(O@yg<yC Ezq9UYO8@`> delta 119 zcmZo=X<_0z^>5cc1_lN@27!rOCj5M9iOGp6srqh-$tC$km6O>S(*xKUn1Bix7#M+& zm4OXNasqk!U_Ju_tJZb~#*IJ$CI&7b36f@DU}oS3l00BGE0E>|@)#NTfFu(GKL9aE B4we7_ diff --git a/out/production/Robot_Factory_PR/makefile b/out/production/Robot_Factory_PR/makefile index c4c8eb2..9f1b581 100644 --- a/out/production/Robot_Factory_PR/makefile +++ b/out/production/Robot_Factory_PR/makefile @@ -23,5 +23,9 @@ update_interfaces: git add robot/interfaces git commit -m "updated interfaces" git push -u origin main +update_ui: + git add ui/ + git commit -m "updated ui" + git push -u origin main fetch_git: - git pull origin main \ No newline at end of file + git pull origin main diff --git a/out/production/Robot_Factory_PR/robot/exceptions/RobotException$1.class b/out/production/Robot_Factory_PR/robot/exceptions/RobotException$1.class deleted file mode 100644 index a93d60e245c444e3f98cb5abec3350b395935a71..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 802 zcmah{+iuf95Ix(tabjGOUZ9~|nwGRpC?Wz0@c^o1MQ(|(Qxu1ws!tnd)wng@%61B0 zz_0KONC+X+58$H^v!+Ufc!*^0%sHOR@y!1E{o@kA9v&K)Lr#ZgVjg*hYAgpbZHf=R zI8Or^CC!YmCzv6B!Najg7`Ez-V`oM%@PgUPV*UqV-PoHVFCX4tKH?}OAI zx%|AAh1aHf{t}aLk}-GOF49k2H&H^F!E8H@ePB6W&+6F>o3jGQD9<3Qmna=}Zve@3&q!iFcuu`l)mm9hNqbRVhiRN0RFP$ofi;)--6hdLSz>oYb( zLOUW!U&@3uo9!qPaVz9WB9d~Ic6^ua6DwELmX$}$I;vzh2z^A3JmA@Pu*;vuSLk2V zv+xaz+TkZ?uQIqwaDEEc2<9{RnbM0`!76T`g8SGeyMrfqN;Zd0DxA;Cm*^X4_CSr^ iMdaV=6yZ(|XxPdEwkaKi>U2KHm^yaJ8kuf#%7s7P*T1&_ diff --git a/out/production/Robot_Factory_PR/robot/exceptions/RobotException.class b/out/production/Robot_Factory_PR/robot/exceptions/RobotException.class index 6e265cfcc20f95689bda7403a8f89eaded005b68..89c40549b5996698969927225fe23d09ea6fe360 100644 GIT binary patch delta 424 zcmZXP%T59@6o&uKMX(I0FoL59<7IRh1iT`~L>I11h#Mb3XF-UDj0q68B)$RZE4Vdc zVvJ#7Vxlg57GJ=P@f28To6~bn`~P3tkLWw+pFjN<00*c%@FI(HB#{bX#()k>+%qR@ zy1DA5f9;nVeo!x+wwo70eLqf?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