diff --git a/.gitignore b/.gitignore index 7da7938..6ee3832 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ local.properties .classpath .settings/ .loadpath +out/ # External tool builders .externalToolBuilders/ @@ -68,14 +69,12 @@ build/ *.tlb *.tli *.tlh -*.tmp *.tmp_proj *.log *.vspscc *.vssscc .builds *.pidb -*.log *.scc # Visual C++ cache files @@ -194,7 +193,6 @@ $RECYCLE.BIN/ *.egg *.egg-info dist/ -build/ eggs/ parts/ var/ diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..5c98b42 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml \ No newline at end of file diff --git a/.idea/dictionaries/smoser.xml b/.idea/dictionaries/smoser.xml new file mode 100644 index 0000000..0a11be1 --- /dev/null +++ b/.idea/dictionaries/smoser.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..146ab09 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml new file mode 100644 index 0000000..ff952c1 --- /dev/null +++ b/.idea/libraries/lib.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..1bb046f --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..81caa97 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..e96534f --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/DungeonGenerator.iml b/DungeonGenerator.iml new file mode 100644 index 0000000..fb8e866 --- /dev/null +++ b/DungeonGenerator.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml deleted file mode 100644 index 83bd967..0000000 --- a/nbproject/build-impl.xml +++ /dev/null @@ -1,1420 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set src.dir - Must set test.src.dir - Must set build.dir - Must set dist.dir - Must set build.classes.dir - Must set dist.javadoc.dir - Must set build.test.classes.dir - Must set build.test.results.dir - Must set build.classes.excludes - Must set dist.jar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set javac.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - No tests executed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set JVM to use for profiling in profiler.info.jvm - Must set profiler agent JVM arguments in profiler.info.jvmargs.agent - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select some files in the IDE or set javac.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - To run this application from the command line without Ant, try: - - java -jar "${dist.jar.resolved}" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set run.class - - - - Must select one file in the IDE or set run.class - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set debug.class - - - - - Must select one file in the IDE or set debug.class - - - - - Must set fix.includes - - - - - - - - - - This target only works when run from inside the NetBeans IDE. - - - - - - - - - Must select one file in the IDE or set profile.class - This target only works when run from inside the NetBeans IDE. - - - - - - - - - This target only works when run from inside the NetBeans IDE. - - - - - - - - - - - - - This target only works when run from inside the NetBeans IDE. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set run.class - - - - - - Must select some files in the IDE or set test.includes - - - - - Must select one file in the IDE or set run.class - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select some files in the IDE or set javac.includes - - - - - - - - - - - - - - - - - - - - Some tests failed; see details above. - - - - - - - - - Must select some files in the IDE or set test.includes - - - - Some tests failed; see details above. - - - - Must select some files in the IDE or set test.class - Must select some method in the IDE or set test.method - - - - Some tests failed; see details above. - - - - - Must select one file in the IDE or set test.class - - - - Must select one file in the IDE or set test.class - Must select some method in the IDE or set test.method - - - - - - - - - - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nbproject/build-native.xml b/nbproject/build-native.xml deleted file mode 100644 index 1aa10a0..0000000 --- a/nbproject/build-native.xml +++ /dev/null @@ -1,951 +0,0 @@ - - - - - - - - - Native Packager Ant calls based on SE support in JavaFX packager - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - self.addMappedName( - (source.indexOf("jfxrt.jar") >= 0) || - (source.indexOf("deploy.jar") >= 0) || - (source.indexOf("javaws.jar") >= 0) || - (source.indexOf("plugin.jar") >= 0) - ? "" : source - ); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties deleted file mode 100644 index 650939c..0000000 --- a/nbproject/genfiles.properties +++ /dev/null @@ -1,8 +0,0 @@ -build.xml.data.CRC32=111761a0 -build.xml.script.CRC32=4709d7a9 -build.xml.stylesheet.CRC32=8064a381@1.79.1.48 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=857ef569 -nbproject/build-impl.xml.script.CRC32=6e9dc783 -nbproject/build-impl.xml.stylesheet.CRC32=05530350@1.79.1.48 diff --git a/nbproject/private/config.properties b/nbproject/private/config.properties deleted file mode 100644 index e69de29..0000000 diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties deleted file mode 100644 index 9e8f740..0000000 --- a/nbproject/private/private.properties +++ /dev/null @@ -1,6 +0,0 @@ -compile.on.save=true -do.depend=false -do.jar=true -javac.debug=true -javadoc.preview=true -user.properties.file=C:\\Users\\MrMcX\\AppData\\Roaming\\NetBeans\\8.1\\build.properties diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml deleted file mode 100644 index 6807a2b..0000000 --- a/nbproject/private/private.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/nbproject/project.properties b/nbproject/project.properties deleted file mode 100644 index f52d0c0..0000000 --- a/nbproject/project.properties +++ /dev/null @@ -1,114 +0,0 @@ -annotation.processing.enabled=true -annotation.processing.enabled.in.editor=false -annotation.processing.processors.list= -annotation.processing.run.all.processors=true -annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output -application.splash=C:\\Users\\MrMcX\\ownCloud\\Rollenspiel\\DSA\\Meister\\DungeonGenerator\\resources\\images\\firewall.png -application.title=DungeonGenerator -application.vendor=MrMcX -auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml -build.classes.dir=${build.dir}/classes -build.classes.excludes=**/*.java,**/*.form -# This directory is removed when the project is cleaned: -build.dir=build -build.generated.dir=${build.dir}/generated -build.generated.sources.dir=${build.dir}/generated-sources -# Only compile against the classpath explicitly listed here: -build.sysclasspath=ignore -build.test.classes.dir=${build.dir}/test/classes -build.test.results.dir=${build.dir}/test/results -# Uncomment to specify the preferred debugger connection transport: -#debug.transport=dt_socket -debug.classpath=\ - ${run.classpath} -debug.test.classpath=\ - ${run.test.classpath} -# Files in build.classes.dir which should be excluded from distribution jar -dist.archive.excludes= -# This directory is removed when the project is cleaned: -dist.dir=dist -dist.jar=${dist.dir}/DungeonGenerator.jar -dist.javadoc.dir=${dist.dir}/javadoc -endorsed.classpath= -excludes= -file.reference.itext-2.1.7.jar=lib/itext-2.1.7.jar -file.reference.jgraph-5.13.0.0.jar=lib/jgraph-5.13.0.0.jar -file.reference.jgrapht-core-0.9.2.jar=lib/jgrapht-core-0.9.2.jar -file.reference.jgrapht-ext-0.9.2.jar=lib/jgrapht-ext-0.9.2.jar -file.reference.jgraphx-2.0.0.1.jar=lib/jgraphx-2.0.0.1.jar -file.reference.pdfbox-app-2.0.2.jar=lib/pdfbox-app-2.0.2.jar -file.reference.resources-images=resources/images -includes=** -jar.archive.disabled=${jnlp.enabled} -jar.compress=false -jar.index=${jnlp.enabled} -javac.classpath=\ - ${libs.absolutelayout.classpath}:\ - ${file.reference.resources-images}:\ - ${file.reference.jgraph-5.13.0.0.jar}:\ - ${file.reference.jgrapht-core-0.9.2.jar}:\ - ${file.reference.jgrapht-ext-0.9.2.jar}:\ - ${file.reference.jgraphx-2.0.0.1.jar}:\ - ${file.reference.itext-2.1.7.jar}:\ - ${file.reference.pdfbox-app-2.0.2.jar} -# Space-separated list of extra javac options -javac.compilerargs= -javac.deprecation=false -javac.external.vm=true -javac.processorpath=\ - ${javac.classpath} -javac.source=1.8 -javac.target=1.8 -javac.test.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -javac.test.processorpath=\ - ${javac.test.classpath} -javadoc.additionalparam= -javadoc.author=false -javadoc.encoding=${source.encoding} -javadoc.noindex=false -javadoc.nonavbar=false -javadoc.notree=false -javadoc.private=false -javadoc.splitindex=true -javadoc.use=true -javadoc.version=false -javadoc.windowtitle= -jnlp.codebase.type=no.codebase -jnlp.descriptor=application -jnlp.enabled=false -jnlp.mixed.code=default -jnlp.offline-allowed=false -jnlp.signed=false -jnlp.signing= -jnlp.signing.alias= -jnlp.signing.keystore= -main.class=eu.smoser.dungeongenerator.main.DungeonGeneratorUI -# Optional override of default Application-Library-Allowable-Codebase attribute identifying the locations where your signed RIA is expected to be found. -manifest.custom.application.library.allowable.codebase= -# Optional override of default Caller-Allowable-Codebase attribute identifying the domains from which JavaScript code can make calls to your RIA without security prompts. -manifest.custom.caller.allowable.codebase= -# Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed -manifest.custom.codebase= -# Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions) -manifest.custom.permissions= -manifest.file=manifest.mf -meta.inf.dir=${src.dir}/META-INF -mkdist.disabled=false -native.bundling.enabled=true -platform.active=default_platform -project.license=mit -run.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -# Space-separated list of JVM arguments used when running the project. -# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. -# To set system properties for unit tests define test-sys-prop.name=value: -run.jvmargs= -run.test.classpath=\ - ${javac.test.classpath}:\ - ${build.test.classes.dir} -source.encoding=UTF-8 -src.dir=src -test.src.dir=test diff --git a/nbproject/project.xml b/nbproject/project.xml deleted file mode 100644 index 88e4ce0..0000000 --- a/nbproject/project.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - org.netbeans.modules.java.j2seproject - - - - - - DungeonGenerator - - - - - - - - - diff --git a/src/eu/smoser/dungeongenerator/dungeon/Dungeon.java b/src/eu/smoser/dungeongenerator/dungeon/Dungeon.java index 1ce106d..adfbcc3 100644 --- a/src/eu/smoser/dungeongenerator/dungeon/Dungeon.java +++ b/src/eu/smoser/dungeongenerator/dungeon/Dungeon.java @@ -1,26 +1,4 @@ -/* - * The MIT License - * - * Copyright 2016 MrMcX. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ + package eu.smoser.dungeongenerator.dungeon; import java.util.*; @@ -39,7 +17,7 @@ public class Dungeon { private final List rooms; private final LinkedList toGenerate; private final Counter counter; - private final HashMap greedyMap; + private final HashMap greedyMap; /** * Standard constructor, creates a new dungeon @@ -56,7 +34,7 @@ public class Dungeon { /** * Returns the greedy map - * @return + * @return HashMap greedy HashMap */ public HashMap GetGreedyMap(){ return greedyMap; @@ -69,26 +47,22 @@ public class Dungeon { * @param mode generation mode */ public void generate(int size, Type type, Mode mode) { - toGenerate.add(Room.RandomRoom(true, Exit.Start(), counter, type, greedyMap)); + toGenerate.add(Room.RandomRoom(true, Exit.Start(), type, greedyMap)); while (!toGenerate.isEmpty() && (rooms.size() < size || Experimental(type))) { Room next; switch (mode) { case STRAIGHT: next = toGenerate.getLast(); break; - case BRANCHED: - next = toGenerate.getFirst(); - break; case RANDOM: next = toGenerate.get(Dice.Roll(toGenerate.size(), 1) - 1); break; default: + // case BRANCHED next = toGenerate.getFirst(); break; } - next.generate(counter, type, greedyMap).stream().forEach((r) -> { - toGenerate.add((Room) r); - }); + toGenerate.addAll(next.generate(counter, type, greedyMap)); toGenerate.remove(next); rooms.add(next); } @@ -105,11 +79,9 @@ public class Dungeon { * @return UndirectedGraph from JGraphT */ public UndirectedGraph toGraph() { - UndirectedGraph g = new SimpleGraph(DefaultEdge.class); - rooms.stream().forEach((r) -> { - g.addVertex(r); - }); - rooms.stream().forEach((r) -> { + UndirectedGraph g = new SimpleGraph(DefaultEdge.class); + rooms.forEach(g::addVertex); + rooms.forEach((r) -> { for (Exit e : r.exits) { if (e.isStart || e.room.number == 0 || g.containsEdge(r, e.room)) { continue; @@ -143,7 +115,7 @@ public class Dungeon { /** * Different room generation sequence modes */ - public static enum Mode { + public enum Mode { /** * FILO - straight dungeon @@ -162,7 +134,7 @@ public class Dungeon { /** * The type of rooms to generate */ - public static enum Type { + public enum Type { /** * Nature-made rooms @@ -182,8 +154,8 @@ public class Dungeon { EXP_ARTIFICIAL } - private static HashMap GreedyMap(int size, Type type) { - HashMap expMap = new HashMap(); + private static HashMap GreedyMap(int size, Type type) { + HashMap expMap = new HashMap<>(); if (Experimental(type)) { double expVal = 1.0 - (1.0 / size); expMap.put(0, expVal); diff --git a/src/eu/smoser/dungeongenerator/dungeon/Exit.java b/src/eu/smoser/dungeongenerator/dungeon/Exit.java index 5dbb788..fabbe8c 100644 --- a/src/eu/smoser/dungeongenerator/dungeon/Exit.java +++ b/src/eu/smoser/dungeongenerator/dungeon/Exit.java @@ -1,26 +1,3 @@ -/* - * The MIT License - * - * Copyright 2016 MrMcX. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ package eu.smoser.dungeongenerator.dungeon; import eu.smoser.dungeongenerator.util.Dice; @@ -44,12 +21,12 @@ public class Exit { /** * If the exit is start */ - public boolean isStart; + boolean isStart; /** * If there is a trap in this exit */ - public boolean isTrap; + private boolean isTrap; /** * Type of trap @@ -94,7 +71,7 @@ public class Exit { * Gives this exits description * @return Description string */ - public String toLongString(){ + String toLongString(){ String out = "- "; if(isStart){ out += "Aus-/Eingang"; @@ -114,7 +91,7 @@ public class Exit { * Gives the entry * @return Entry of dungeon */ - public static Exit Start(){ + static Exit Start(){ return new Exit(null, null, true); } diff --git a/src/eu/smoser/dungeongenerator/dungeon/Room.java b/src/eu/smoser/dungeongenerator/dungeon/Room.java index b7d248f..97277c2 100644 --- a/src/eu/smoser/dungeongenerator/dungeon/Room.java +++ b/src/eu/smoser/dungeongenerator/dungeon/Room.java @@ -1,33 +1,11 @@ -/* - * The MIT License - * - * Copyright 2016 MrMcX. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ package eu.smoser.dungeongenerator.dungeon; import eu.smoser.dungeongenerator.dungeon.objects.*; import eu.smoser.dungeongenerator.util.*; + import java.util.*; + /** - * * @author MrMcX */ public class Room { @@ -42,43 +20,44 @@ public class Room { */ public Exit[] exits; - - private Dungeon.Type type; + + private Dungeon.Type type; private final boolean isRoom; - private boolean hasMonster, hasTrap, hasMagic, hasSpecial, hasTreasure = false; + private boolean hasMonster, hasTrap, hasMagic, hasSpecial, hasTreasure = false; private ADungeonObject treasure, magic, enemy, trap, special; - private String desc = null; - + private String desc; // = null + /** * Constructs a room with a given predecessor, number of exits, description and counter - * @param predecessor Predecessor room + * + * @param predecessor Predecessor room * @param numberOfExits Number of exits - * @param room Whether it is a room - * @param desc Description of room - * @param c Room counter + * @param room Whether it is a room + * @param desc Description of room */ - public Room(Exit predecessor, int numberOfExits, boolean room, String desc, Counter c){ + public Room(Exit predecessor, int numberOfExits, boolean room, String desc) { exits = new Exit[numberOfExits]; exits[0] = predecessor; this.isRoom = room; this.desc = desc; number = 0; } - + /** * Generates the content of the room - * @param c Room counter + * + * @param c Room counter * @param type Environment type - * @param map Experimental map + * @param map Experimental map * @return Returns more rooms to generate */ - public List generate(Counter c, Dungeon.Type type, HashMap map){ + public List generate(Counter c, Dungeon.Type type, HashMap map) { number = c.Next(); - List list = new LinkedList(); - for(int i = 0; i < exits.length; i++){ - if(exits[i] == null){ + List list = new LinkedList<>(); + for (int i = 0; i < exits.length; i++) { + if (exits[i] == null) { Exit predecessor = new Exit(this); - Room newRoom = RandomRoom(false, predecessor, c, type, map); + Room newRoom = RandomRoom(false, predecessor, type, map); exits[i] = new Exit(newRoom, predecessor.type); list.add(newRoom); } @@ -86,12 +65,13 @@ public class Room { SetContents(type); return list; } - - private void SetContents(Dungeon.Type type){ - if(isRoom){ - switch(Dice.Roll(6, 2)){ + + private void SetContents(Dungeon.Type type) { + if (isRoom) { + switch (Dice.Roll(6, 2)) { case 2: - case 3: return; + case 3: + return; case 4: hasMonster = true; enemy = new Enemy(type); @@ -137,11 +117,12 @@ public class Room { return; } } else { - switch(Dice.Roll(6, 1)){ + switch (Dice.Roll(6, 1)) { case 1: case 2: - case 3: return; - case 4: + case 3: + return; + case 4: hasMonster = true; enemy = new Enemy(type); return; @@ -157,178 +138,190 @@ public class Room { } this.type = type; } - + @Override - public String toString(){ - if(!isRoom){ + public String toString() { + if (!isRoom) { return "Gang " + number; - } else if(Dungeon.Natural(type)){ - return "Höhle " + number; + } else if (Dungeon.Natural(type)) { + return "Höhle " + number; } else { return "Raum " + number; - } + } } - + /** * Returns a long description + * * @return Long description string */ - public String toLongString(){ - String out = ""; - if(isRoom){ - out += "Raum "; + String toLongString() { + StringBuilder out = new StringBuilder(); + if (isRoom) { + out.append("Raum "); } else { - out += "Gang "; + out.append("Gang "); } - out += "Nummer " + number + ": " + desc + "\n" + - "Ausgänge:\n"; - for(Exit x : exits){ - out += x.toLongString(); + out.append("Nummer ").append(number).append(": ").append(desc).append("\n").append("Ausgänge:\n"); + for (Exit x : exits) { + out.append(x.toLongString()); } - if(hasMonster){ - out += "Gegner:\n- " + enemy + "\n"; + if (hasMonster) { + out.append("Gegner:\n- ").append(enemy).append("\n"); } - if(hasTrap){ - out += "Fallen:\n- " + trap + "\n"; + if (hasTrap) { + out.append("Fallen:\n- ").append(trap).append("\n"); } - if(hasMagic){ - out += "Magische Phänomene:\n- " + magic + "\n"; + if (hasMagic) { + out.append("Magische Phänomene:\n- ").append(magic).append("\n"); } - if(hasSpecial){ - out += "Besondere Phänomene:\n- " + special + "\n"; + if (hasSpecial) { + out.append("Besondere Phänomene:\n- ").append(special).append("\n"); } - if(hasTreasure){ - out += "Fundsache:\n- " + treasure + "\n"; + if (hasTreasure) { + out.append("Fundsache:\n- ").append(treasure).append("\n"); } - return out; + return out.toString(); } - + /** * Returns a short description + * * @return Short description string */ - public String toShortString(){ - if(isRoom){ + String toShortString() { + if (isRoom) { return "Raum Nummer " + number; } else { return "Gang Nummer " + number; } } - - private static Room RoomBigExits(Exit predecessor, Counter c, Dungeon.Type type){ + + private static Room RoomBigExits(Exit predecessor, Dungeon.Type type) { int rand = Dice.Roll(3, 1); - if(Dungeon.Natural(type)){ - return new Room(predecessor, rand + 1, true, "große Höhle mit " + rand + " Ausgängen", c); + if (Dungeon.Natural(type)) { + return new Room(predecessor, rand + 1, true, "große Höhle mit " + rand + " Ausgängen"); } else { - return new Room(predecessor, rand + 1, true, "großer Raum mit " + rand + " Ausgängen", c); - } + return new Room(predecessor, rand + 1, true, "großer Raum mit " + rand + " Ausgängen"); + } } - - private static Room RoomSmallExits(Exit predecessor, Counter c, Dungeon.Type type){ + + private static Room RoomSmallExits(Exit predecessor, Dungeon.Type type) { int rand = Dice.Roll(3, 1); - if(Dungeon.Natural(type)){ - return new Room(predecessor, rand + 1, true, "kleine Höhle mit " + rand + " Ausgängen", c); + if (Dungeon.Natural(type)) { + return new Room(predecessor, rand + 1, true, "kleine Höhle mit " + rand + " Ausgängen"); } else { - return new Room(predecessor, rand + 1, true, "kleiner Raum mit " + rand + " Ausgängen", c); - } + return new Room(predecessor, rand + 1, true, "kleiner Raum mit " + rand + " Ausgängen"); + } } - - private static Room RoomBigNoExits(Exit predecessor, Counter c, Dungeon.Type type){ - if(Dungeon.Natural(type)){ - return new Room(predecessor, 1, true, "große Höhle ohne Ausgang", c); + + private static Room RoomBigNoExits(Exit predecessor, Dungeon.Type type) { + if (Dungeon.Natural(type)) { + return new Room(predecessor, 1, true, "große Höhle ohne Ausgang"); } else { - return new Room(predecessor, 1, true, "großer Raum ohne Ausgang", c); - } + return new Room(predecessor, 1, true, "großer Raum ohne Ausgang"); + } } - - private static Room RoomBigExitsStair(Exit predecessor, Counter c, Dungeon.Type type){ + + private static Room RoomBigExitsStair(Exit predecessor, Dungeon.Type type) { int rand = Dice.Roll(2, 1); - if(Dungeon.Natural(type)){ - return new Room(predecessor, rand + 2, true, "große Höhle mit " + rand + " Ausgängen und einer Treppe", c); + if (Dungeon.Natural(type)) { + return new Room(predecessor, rand + 2, true, "große Höhle mit " + rand + " Ausgängen und einer Treppe"); } else { - return new Room(predecessor, rand + 2, true, "großer Raum mit " + rand + " Ausgängen und einer Treppe", c); - } + return new Room(predecessor, rand + 2, true, "großer Raum mit " + rand + " Ausgängen und einer Treppe"); + } } - - private static Room RoomSmallNoExits(Exit predecessor, Counter c, Dungeon.Type type){ - if(Dungeon.Natural(type)){ - return new Room(predecessor, 1, true, "kleine Höhle ohne Ausgang", c); + + private static Room RoomSmallNoExits(Exit predecessor, Dungeon.Type type) { + if (Dungeon.Natural(type)) { + return new Room(predecessor, 1, true, "kleine Höhle ohne Ausgang"); } else { - return new Room(predecessor, 1, true, "kleiner Raum ohne Ausgang", c); - } + return new Room(predecessor, 1, true, "kleiner Raum ohne Ausgang"); + } } - - private static Room RoomSmallExitsStair(Exit predecessor, Counter c, Dungeon.Type type){ + + private static Room RoomSmallExitsStair(Exit predecessor, Dungeon.Type type) { int rand = Dice.Roll(2, 1); - if(Dungeon.Natural(type)){ - return new Room(predecessor, rand + 2, true, "kleine Höhle mit " + rand + " Ausgängen und einer Treppe", c); + if (Dungeon.Natural(type)) { + return new Room(predecessor, rand + 2, true, "kleine Höhle mit " + rand + " Ausgängen und einer Treppe"); } else { - return new Room(predecessor, rand + 2, true, "kleiner Raum mit " + rand + " Ausgängen und einer Treppe", c); - } + return new Room(predecessor, rand + 2, true, "kleiner Raum mit " + rand + " Ausgängen und einer Treppe"); + } } - - private static Room RoomGiant(Exit predecessor, Counter c, Dungeon.Type type){ + + private static Room RoomGiant(Exit predecessor, Dungeon.Type type) { int rand = Dice.Roll(2, 1); - if(Dungeon.Natural(type)){ - return new Room(predecessor, rand + 1, true, "gigantische Höhle mit " + rand + " Ausgängen", c); + if (Dungeon.Natural(type)) { + return new Room(predecessor, rand + 1, true, "gigantische Höhle mit " + rand + " Ausgängen"); } else { - return new Room(predecessor, rand + 1, true, "gigantischer Raum mit " + rand + " Ausgängen", c); - } + return new Room(predecessor, rand + 1, true, "gigantischer Raum mit " + rand + " Ausgängen"); + } } - - private static Room Corridor(Exit predecessor, Counter c){ - return new Room(predecessor, 2, false, "Gang", c); + + private static Room Corridor(Exit predecessor) { + return new Room(predecessor, 2, false, "Gang"); } - - private static Room CrossingT(Exit predecessor, Counter c){ - return new Room(predecessor, 3, false, "T-Kreuzung mit Abzweigungen nach links und rechts", c); + + private static Room CrossingT(Exit predecessor) { + return new Room(predecessor, 3, false, "T-Kreuzung mit Abzweigungen nach links und rechts"); } - - private static Room Crossing(Exit predecessor, Counter c){ - return new Room(predecessor, 4, false, "Kreuzung, die in alle Richtungen weitergeht", c); + + private static Room Crossing(Exit predecessor) { + return new Room(predecessor, 4, false, "Kreuzung, die in alle Richtungen weitergeht"); } - - private static Room DeadEnd(Exit predecessor, Counter c){ - return new Room(predecessor, 1, false, "Sackgasse", c); + + private static Room DeadEnd(Exit predecessor) { + return new Room(predecessor, 1, false, "Sackgasse"); } - + /** * Generates a random room - * @param first Whether it is the first room + * + * @param first Whether it is the first room * @param predecessor Predecessor room - * @param c Room counter - * @param type Environment type - * @param map The map for experimental mode + * @param type Environment type + * @param map The map for experimental mode * @return random room */ - public static Room RandomRoom(boolean first, Exit predecessor, Counter c, Dungeon.Type type, HashMap map){ + static Room RandomRoom(boolean first, Exit predecessor, Dungeon.Type type, HashMap map) { int number; - if(first){ + if (first) { number = Dice.Roll(6, 1); } else { number = Dice.Roll(20, 1); } - switch(map.get(number)){ + switch ((int) map.get(number)) { case 1: case 2: - case 3: return RoomBigExits(predecessor, c, type); + case 3: + return RoomBigExits(predecessor, type); case 4: case 5: - case 6: return RoomSmallExits(predecessor, c, type); - case 7: return RoomBigNoExits(predecessor, c, type); + case 6: + return RoomSmallExits(predecessor, type); + case 7: + return RoomBigNoExits(predecessor, type); case 8: - case 9: return RoomBigExitsStair(predecessor, c, type); - case 10: return RoomSmallNoExits(predecessor, c, type); + case 9: + return RoomBigExitsStair(predecessor, type); + case 10: + return RoomSmallNoExits(predecessor, type); case 11: - case 12: return RoomSmallExitsStair(predecessor, c, type); + case 12: + return RoomSmallExitsStair(predecessor, type); case 13: - case 14: return RoomGiant(predecessor, c, type); - case 15: - case 16: - case 17: return Corridor(predecessor, c); - case 18: return CrossingT(predecessor, c); - case 19: return Crossing(predecessor, c); - case 20: return DeadEnd(predecessor, c); + case 14: + return RoomGiant(predecessor, type); + case 15: + case 16: + case 17: + return Corridor(predecessor); + case 18: + return CrossingT(predecessor); + case 19: + return Crossing(predecessor); + case 20: + return DeadEnd(predecessor); } return null; } diff --git a/src/eu/smoser/dungeongenerator/dungeon/objects/ADungeonObject.java b/src/eu/smoser/dungeongenerator/dungeon/objects/ADungeonObject.java index f83c188..48153cb 100644 --- a/src/eu/smoser/dungeongenerator/dungeon/objects/ADungeonObject.java +++ b/src/eu/smoser/dungeongenerator/dungeon/objects/ADungeonObject.java @@ -1,26 +1,3 @@ -/* - * The MIT License - * - * Copyright 2016 MrMcX. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ package eu.smoser.dungeongenerator.dungeon.objects; /** diff --git a/src/eu/smoser/dungeongenerator/dungeon/objects/Encounters.java b/src/eu/smoser/dungeongenerator/dungeon/objects/Encounters.java index 162a5ac..067c06c 100644 --- a/src/eu/smoser/dungeongenerator/dungeon/objects/Encounters.java +++ b/src/eu/smoser/dungeongenerator/dungeon/objects/Encounters.java @@ -1,26 +1,3 @@ -/* - * The MIT License - * - * Copyright 2016 MrMcX. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ package eu.smoser.dungeongenerator.dungeon.objects; import eu.smoser.dungeongenerator.dungeon.Dungeon; @@ -32,13 +9,17 @@ import eu.smoser.dungeongenerator.util.Dice; */ public class Encounters extends ADungeonObject{ public Encounters(int num, Dungeon.Type type){ - descString = ""; + StringBuilder sb = new StringBuilder(); for(int i = 1; i <= num; i++){ - descString += i + ": " + Encounter(type) + "\n"; + sb.append(i); + sb.append(": "); + sb.append(Encounter(type)); + sb.append("\n"); } + descString = sb.toString(); } - public static String Encounter(Dungeon.Type type){ + private static String Encounter(Dungeon.Type type){ if(Dungeon.Natural(type)){ switch(Dice.Roll(20, 1)){ case 1: return "Ein Höhlenbewohner behauptet, er sei der Häuptling eines ganzen Stammes und bietet den Helden die Freundschaft an. In Wirklichkeit ist er nur ein unbedeutender Kundschafter, der keinerlei Befehlsgewalt hat, nachdem er die Helden zum Stamm geführt hat."; @@ -90,13 +71,13 @@ public class Encounters extends ADungeonObject{ } private static String EnemyList(int num, Dungeon.Type type){ - String out = ""; + StringBuilder out = new StringBuilder(); for(int i = 0; i < num; i++){ - out += new Enemy(type).toString(); + out.append(new Enemy(type).toString()); if(i < (num - 1)){ - out += ", "; + out.append(", "); } } - return out; + return out.toString(); } } diff --git a/src/eu/smoser/dungeongenerator/dungeon/objects/Enemy.java b/src/eu/smoser/dungeongenerator/dungeon/objects/Enemy.java index 5b22a64..102774d 100644 --- a/src/eu/smoser/dungeongenerator/dungeon/objects/Enemy.java +++ b/src/eu/smoser/dungeongenerator/dungeon/objects/Enemy.java @@ -1,26 +1,3 @@ -/* - * The MIT License - * - * Copyright 2016 MrMcX. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ package eu.smoser.dungeongenerator.dungeon.objects; import eu.smoser.dungeongenerator.dungeon.Dungeon; diff --git a/src/eu/smoser/dungeongenerator/dungeon/objects/Magic.java b/src/eu/smoser/dungeongenerator/dungeon/objects/Magic.java index 4269f37..334eca9 100644 --- a/src/eu/smoser/dungeongenerator/dungeon/objects/Magic.java +++ b/src/eu/smoser/dungeongenerator/dungeon/objects/Magic.java @@ -1,26 +1,3 @@ -/* - * The MIT License - * - * Copyright 2016 MrMcX. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ package eu.smoser.dungeongenerator.dungeon.objects; import eu.smoser.dungeongenerator.dungeon.Dungeon; diff --git a/src/eu/smoser/dungeongenerator/dungeon/objects/Special.java b/src/eu/smoser/dungeongenerator/dungeon/objects/Special.java index 17c16b1..9b7cd43 100644 --- a/src/eu/smoser/dungeongenerator/dungeon/objects/Special.java +++ b/src/eu/smoser/dungeongenerator/dungeon/objects/Special.java @@ -1,26 +1,3 @@ -/* - * The MIT License - * - * Copyright 2016 MrMcX. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ package eu.smoser.dungeongenerator.dungeon.objects; import eu.smoser.dungeongenerator.dungeon.Dungeon; diff --git a/src/eu/smoser/dungeongenerator/dungeon/objects/Trap.java b/src/eu/smoser/dungeongenerator/dungeon/objects/Trap.java index e6d58e8..5213de6 100644 --- a/src/eu/smoser/dungeongenerator/dungeon/objects/Trap.java +++ b/src/eu/smoser/dungeongenerator/dungeon/objects/Trap.java @@ -1,26 +1,3 @@ -/* - * The MIT License - * - * Copyright 2016 MrMcX. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ package eu.smoser.dungeongenerator.dungeon.objects; import eu.smoser.dungeongenerator.util.Dice; diff --git a/src/eu/smoser/dungeongenerator/dungeon/objects/Treasure.java b/src/eu/smoser/dungeongenerator/dungeon/objects/Treasure.java index 136f155..9d18cac 100644 --- a/src/eu/smoser/dungeongenerator/dungeon/objects/Treasure.java +++ b/src/eu/smoser/dungeongenerator/dungeon/objects/Treasure.java @@ -1,26 +1,3 @@ -/* - * The MIT License - * - * Copyright 2016 MrMcX. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ package eu.smoser.dungeongenerator.dungeon.objects; import eu.smoser.dungeongenerator.util.Dice; diff --git a/src/eu/smoser/dungeongenerator/main/AGenerator.java b/src/eu/smoser/dungeongenerator/main/AGenerator.java new file mode 100644 index 0000000..abe1e82 --- /dev/null +++ b/src/eu/smoser/dungeongenerator/main/AGenerator.java @@ -0,0 +1,40 @@ +package eu.smoser.dungeongenerator.main; + +import javax.swing.*; + +abstract class AGenerator extends javax.swing.JFrame { + AGenerator() { + JButton jButtonStart = new JButton(); + JPanel jPanel1 = new JPanel(); + Box.Filler filler1 = new Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); + jSpinner = new javax.swing.JSpinner(); + JLabel jLabel1 = new JLabel(); + Box.Filler filler2 = new Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); + JScrollPane jScrollPane1 = new JScrollPane(); + JTextArea jText = new JTextArea(); + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + + cInitComponents(jButtonStart, jLabel1, jPanel1); + + jButtonStart.addActionListener(e -> jText.setText(getText())); + getContentPane().add(jButtonStart, java.awt.BorderLayout.PAGE_END); + jPanel1.setLayout(new java.awt.GridLayout(1, 4)); + jPanel1.add(filler1); + jSpinner.setModel(new javax.swing.SpinnerNumberModel(1, 1, null, 1)); + jPanel1.add(jSpinner); + jPanel1.add(jLabel1); + jPanel1.add(filler2); + getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_START); + jText.setColumns(20); + jText.setRows(5); + jScrollPane1.setViewportView(jText); + getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER); + pack(); + } + + abstract void cInitComponents(JButton jButtonStart, JLabel jLabel1, JPanel jPanel1); + + abstract String getText(); + + javax.swing.JSpinner jSpinner; +} diff --git a/src/eu/smoser/dungeongenerator/main/DungeonGeneratorUI.java b/src/eu/smoser/dungeongenerator/main/DungeonGeneratorUI.java index fdf66ea..ef9d758 100644 --- a/src/eu/smoser/dungeongenerator/main/DungeonGeneratorUI.java +++ b/src/eu/smoser/dungeongenerator/main/DungeonGeneratorUI.java @@ -552,7 +552,7 @@ public class DungeonGeneratorUI extends javax.swing.JFrame { private void jMenuItemHelpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemHelpActionPerformed try { - Desktop.getDesktop().browse(new URI("https://github.com/MrMcX/DungeonGenerator/issues")); + Desktop.getDesktop().browse(new URI("https://naclador.de/git/mosers/DungeonGenerator/issues")); } catch (URISyntaxException | IOException ex) { Logger.getLogger(DungeonGeneratorUI.class.getName()).log(Level.SEVERE, null, ex); } @@ -560,7 +560,7 @@ public class DungeonGeneratorUI extends javax.swing.JFrame { private void jMenuItemGithubActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemGithubActionPerformed try { - Desktop.getDesktop().browse(new URI("https://github.com/MrMcX/DungeonGenerator/")); + Desktop.getDesktop().browse(new URI("https://naclador.de/git/mosers/DungeonGenerator/")); } catch (URISyntaxException | IOException ex) { Logger.getLogger(DungeonGeneratorUI.class.getName()).log(Level.SEVERE, null, ex); } diff --git a/src/eu/smoser/dungeongenerator/main/EncounterGenerator.java b/src/eu/smoser/dungeongenerator/main/EncounterGenerator.java index 89be893..6b17b59 100644 --- a/src/eu/smoser/dungeongenerator/main/EncounterGenerator.java +++ b/src/eu/smoser/dungeongenerator/main/EncounterGenerator.java @@ -1,158 +1,67 @@ -/* - * The MIT License - * - * Copyright 2016 MrMcX. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ package eu.smoser.dungeongenerator.main; import eu.smoser.dungeongenerator.dungeon.Dungeon; import eu.smoser.dungeongenerator.dungeon.objects.Encounters; +import javax.swing.*; +import java.util.Objects; + /** * * @author MrMcX */ -public class EncounterGenerator extends javax.swing.JFrame { - - /** - * Creates new form EncounterGenerator - */ - public EncounterGenerator() { - initComponents(); - } - +public class EncounterGenerator extends AGenerator { /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - jButtonStart = new javax.swing.JButton(); - jPanel1 = new javax.swing.JPanel(); - filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); - jSpinner = new javax.swing.JSpinner(); - jLabel1 = new javax.swing.JLabel(); - filler3 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); - jLabel2 = new javax.swing.JLabel(); - jCombo = new javax.swing.JComboBox<>(); - filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); - jScrollPane1 = new javax.swing.JScrollPane(); - jText = new javax.swing.JTextArea(); - - setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + @Override + void cInitComponents(JButton jButtonStart, JLabel jLabel1, JPanel jPanel1) { + JLabel jLabel2 = new JLabel(); + Box.Filler filler3 = new Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); + jCombo = new JComboBox<>(); setTitle("Zufallsbegegnungen generieren"); setMinimumSize(new java.awt.Dimension(800, 600)); - setName("Zufallsbegegnungen"); // NOI18N - + setName("Zufallsbegegnungen"); jButtonStart.setText("Zufallsbegegnungen starten"); - jButtonStart.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - jButtonStartActionPerformed(evt); - } - }); - getContentPane().add(jButtonStart, java.awt.BorderLayout.PAGE_END); - - jPanel1.setLayout(new java.awt.GridLayout(1, 7)); - jPanel1.add(filler1); - - jSpinner.setModel(new javax.swing.SpinnerNumberModel(1, 1, null, 1)); - jPanel1.add(jSpinner); - - jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setHorizontalAlignment(SwingConstants.CENTER); jLabel1.setText("Begegnungen"); jPanel1.add(jLabel1); jPanel1.add(filler3); - jLabel2.setText("Dungeonart"); jPanel1.add(jLabel2); - - jCombo.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Natürlich", "Künstlich" })); + jCombo.setModel(new DefaultComboBoxModel<>(new String[] { "Natürlich", "Künstlich" })); jPanel1.add(jCombo); - jPanel1.add(filler2); - - getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_START); - - jText.setColumns(20); - jText.setRows(5); - jScrollPane1.setViewportView(jText); - - getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER); - - pack(); - }// //GEN-END:initComponents + } - private void jButtonStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonStartActionPerformed - Encounters e = new Encounters((int) jSpinner.getValue(), jCombo.getSelectedItem().equals("Natürlich") ? Dungeon.Type.NATURAL : Dungeon.Type.ARTIFICIAL); - jText.setText(e.toString()); - }//GEN-LAST:event_jButtonStartActionPerformed + @Override + String getText() { + Encounters e = new Encounters((int) jSpinner.getValue(), Objects.equals(jCombo.getSelectedItem(), "Natürlich") ? Dungeon.Type.NATURAL : Dungeon.Type.ARTIFICIAL); + return e.toString(); + } /** * @param args the command line arguments */ - public static void main(String args[]) { + public static void main(String[] args) { /* Set the Nimbus look and feel */ - // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { - for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { - javax.swing.UIManager.setLookAndFeel(info.getClassName()); + UIManager.setLookAndFeel(info.getClassName()); break; } } - } catch (ClassNotFoundException ex) { - java.util.logging.Logger.getLogger(EncounterGenerator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (InstantiationException ex) { - java.util.logging.Logger.getLogger(EncounterGenerator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (IllegalAccessException ex) { - java.util.logging.Logger.getLogger(EncounterGenerator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (javax.swing.UnsupportedLookAndFeelException ex) { + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(EncounterGenerator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } - // - /* Create and display the form */ - java.awt.EventQueue.invokeLater(new Runnable() { - public void run() { - new EncounterGenerator().setVisible(true); - } - }); + java.awt.EventQueue.invokeLater(() -> new EncounterGenerator().setVisible(true)); } - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.Box.Filler filler1; - private javax.swing.Box.Filler filler2; - private javax.swing.Box.Filler filler3; - private javax.swing.JButton jButtonStart; - private javax.swing.JComboBox jCombo; - private javax.swing.JLabel jLabel1; - private javax.swing.JLabel jLabel2; - private javax.swing.JPanel jPanel1; - private javax.swing.JScrollPane jScrollPane1; - private javax.swing.JSpinner jSpinner; - private javax.swing.JTextArea jText; - // End of variables declaration//GEN-END:variables + private JComboBox jCombo; } diff --git a/src/eu/smoser/dungeongenerator/main/TreasureGenerator.java b/src/eu/smoser/dungeongenerator/main/TreasureGenerator.java index b2cf23e..d1e5895 100644 --- a/src/eu/smoser/dungeongenerator/main/TreasureGenerator.java +++ b/src/eu/smoser/dungeongenerator/main/TreasureGenerator.java @@ -1,146 +1,58 @@ -/* - * The MIT License - * - * Copyright 2016 mosers. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ package eu.smoser.dungeongenerator.main; import eu.smoser.dungeongenerator.dungeon.objects.Treasure; +import javax.swing.*; + /** * * @author mosers */ -public class TreasureGenerator extends javax.swing.JFrame { - - /** - * Creates new form TreasureGenerator - */ - public TreasureGenerator() { - initComponents(); - } - +public class TreasureGenerator extends AGenerator { /** * This method is called from within the constructor to initialize the form. - * WARNING: Do NOT modify this code. The content of this method is always - * regenerated by the Form Editor. */ - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - jButtonStart = new javax.swing.JButton(); - jPanel1 = new javax.swing.JPanel(); - filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); - jSpinner = new javax.swing.JSpinner(); - jLabel1 = new javax.swing.JLabel(); - filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); - jScrollPane1 = new javax.swing.JScrollPane(); - jText = new javax.swing.JTextArea(); - - setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + @Override + void cInitComponents(JButton jButtonStart, JLabel jLabel1, JPanel jPanel1) { setTitle("Schätze generieren"); setMinimumSize(new java.awt.Dimension(800, 600)); - jButtonStart.setText("Schatz generieren"); jButtonStart.setToolTipText(""); - jButtonStart.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - jButtonStartActionPerformed(evt); - } - }); - getContentPane().add(jButtonStart, java.awt.BorderLayout.PAGE_END); - - jPanel1.setLayout(new java.awt.GridLayout(1, 4)); - jPanel1.add(filler1); - - jSpinner.setModel(new javax.swing.SpinnerNumberModel(1, 1, null, 1)); - jPanel1.add(jSpinner); - jLabel1.setText("Handvoll"); - jPanel1.add(jLabel1); - jPanel1.add(filler2); - - getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_START); - - jText.setColumns(20); - jText.setRows(5); - jScrollPane1.setViewportView(jText); - - getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER); - - pack(); - }// //GEN-END:initComponents + } - private void jButtonStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonStartActionPerformed - String text = ""; + @Override + String getText() { + StringBuilder text = new StringBuilder(); for(int i = 1; i <= (int) jSpinner.getValue(); i++){ - text += i + " Handvoll:\n" + Treasure.DetailedTreasure() + "\n\n"; + text.append(i); + text.append(". Handvoll:\n"); + text.append(Treasure.DetailedTreasure()); + text.append("\n\n"); } - jText.setText(text); - }//GEN-LAST:event_jButtonStartActionPerformed + return text.toString(); + } /** * @param args the command line arguments */ - public static void main(String args[]) { + public static void main(String[] args) { /* Set the Nimbus look and feel */ - // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { - for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { - javax.swing.UIManager.setLookAndFeel(info.getClassName()); + UIManager.setLookAndFeel(info.getClassName()); break; } } - } catch (ClassNotFoundException ex) { - java.util.logging.Logger.getLogger(TreasureGenerator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (InstantiationException ex) { - java.util.logging.Logger.getLogger(TreasureGenerator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (IllegalAccessException ex) { - java.util.logging.Logger.getLogger(TreasureGenerator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (javax.swing.UnsupportedLookAndFeelException ex) { + } catch (ClassNotFoundException | UnsupportedLookAndFeelException | IllegalAccessException | InstantiationException ex) { java.util.logging.Logger.getLogger(TreasureGenerator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } - // /* Create and display the form */ - java.awt.EventQueue.invokeLater(new Runnable() { - public void run() { - new TreasureGenerator().setVisible(true); - } - }); + java.awt.EventQueue.invokeLater(() -> new TreasureGenerator().setVisible(true)); } - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.Box.Filler filler1; - private javax.swing.Box.Filler filler2; - private javax.swing.JButton jButtonStart; - private javax.swing.JLabel jLabel1; - private javax.swing.JPanel jPanel1; - private javax.swing.JScrollPane jScrollPane1; - private javax.swing.JSpinner jSpinner; - private javax.swing.JTextArea jText; - // End of variables declaration//GEN-END:variables } diff --git a/src/eu/smoser/dungeongenerator/util/Counter.java b/src/eu/smoser/dungeongenerator/util/Counter.java index f4aed86..484ac85 100644 --- a/src/eu/smoser/dungeongenerator/util/Counter.java +++ b/src/eu/smoser/dungeongenerator/util/Counter.java @@ -1,26 +1,3 @@ -/* - * The MIT License - * - * Copyright 2016 MrMcX. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ package eu.smoser.dungeongenerator.util; /** @@ -45,12 +22,4 @@ public class Counter { counter++; return counter; } - - /** - * Shows the current number without increasing it - * @return current number - */ - public int Peek(){ - return counter; - } } diff --git a/src/eu/smoser/dungeongenerator/util/Dice.java b/src/eu/smoser/dungeongenerator/util/Dice.java index 78a1735..bd530ca 100644 --- a/src/eu/smoser/dungeongenerator/util/Dice.java +++ b/src/eu/smoser/dungeongenerator/util/Dice.java @@ -1,26 +1,3 @@ -/* - * The MIT License - * - * Copyright 2016 MrMcX. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ package eu.smoser.dungeongenerator.util; import java.util.Random;