From 627f0f96abcb4d74764510b596f06fd687d781b9 Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Wed, 11 Mar 2020 11:07:48 +0100 Subject: [PATCH] Move into own package --- fuzz.sh | 2 +- src/edu/kit/informatik/{ => cardgame}/Main.java | 4 ++-- .../kit/informatik/{ => cardgame}/MainTest.java | 3 ++- .../kit/informatik/{ => cardgame}/model/Card.java | 2 +- .../informatik/{ => cardgame}/model/CardGame.java | 14 +++++++------- .../kit/informatik/{ => cardgame}/model/Item.java | 8 ++++---- .../{ => cardgame}/model/LogicException.java | 2 +- .../informatik/{ => cardgame}/ui/CommandLine.java | 10 +++++----- .../{ => cardgame}/ui/InvalidInputException.java | 2 +- .../{ => cardgame}/ui/command/Build.java | 12 ++++++------ .../{ => cardgame}/ui/command/Buildable.java | 12 ++++++------ .../{ => cardgame}/ui/command/Command.java | 8 ++++---- .../{ => cardgame}/ui/command/CommandFactory.java | 5 ++--- .../informatik/{ => cardgame}/ui/command/Draw.java | 10 +++++----- .../{ => cardgame}/ui/command/ListBuildings.java | 12 ++++++------ .../{ => cardgame}/ui/command/ListResources.java | 12 ++++++------ .../{ => cardgame}/ui/command/Reset.java | 10 +++++----- .../{ => cardgame}/ui/command/RollDice.java | 10 +++++----- .../{ => cardgame}/ui/command/Start.java | 10 +++++----- 19 files changed, 74 insertions(+), 74 deletions(-) rename src/edu/kit/informatik/{ => cardgame}/Main.java (77%) rename src/edu/kit/informatik/{ => cardgame}/MainTest.java (95%) rename src/edu/kit/informatik/{ => cardgame}/model/Card.java (98%) rename src/edu/kit/informatik/{ => cardgame}/model/CardGame.java (94%) rename src/edu/kit/informatik/{ => cardgame}/model/Item.java (92%) rename src/edu/kit/informatik/{ => cardgame}/model/LogicException.java (74%) rename src/edu/kit/informatik/{ => cardgame}/ui/CommandLine.java (87%) rename src/edu/kit/informatik/{ => cardgame}/ui/InvalidInputException.java (77%) rename src/edu/kit/informatik/{ => cardgame}/ui/command/Build.java (74%) rename src/edu/kit/informatik/{ => cardgame}/ui/command/Buildable.java (71%) rename src/edu/kit/informatik/{ => cardgame}/ui/command/Command.java (76%) rename src/edu/kit/informatik/{ => cardgame}/ui/command/CommandFactory.java (94%) rename src/edu/kit/informatik/{ => cardgame}/ui/command/Draw.java (65%) rename src/edu/kit/informatik/{ => cardgame}/ui/command/ListBuildings.java (70%) rename src/edu/kit/informatik/{ => cardgame}/ui/command/ListResources.java (69%) rename src/edu/kit/informatik/{ => cardgame}/ui/command/Reset.java (66%) rename src/edu/kit/informatik/{ => cardgame}/ui/command/RollDice.java (76%) rename src/edu/kit/informatik/{ => cardgame}/ui/command/Start.java (90%) diff --git a/fuzz.sh b/fuzz.sh index 7230a98..6735501 100755 --- a/fuzz.sh +++ b/fuzz.sh @@ -3,7 +3,7 @@ while true; do radamsa -o /tmp/input$$-%n -n 100 ~/Documents/KIT/2019/Prog/final2/*input.txt for filename in /tmp/input$$-*; do echo "exit" >> $filename - java -cp out/production/final2/ -Xshare:on edu.kit.informatik.Main < $filename + java -cp out/production/final2/ -Xshare:on edu.kit.informatik.cardgame.Main < $filename if [ $? -eq 0 ]; then echo OK else diff --git a/src/edu/kit/informatik/Main.java b/src/edu/kit/informatik/cardgame/Main.java similarity index 77% rename from src/edu/kit/informatik/Main.java rename to src/edu/kit/informatik/cardgame/Main.java index 17191b5..381f758 100644 --- a/src/edu/kit/informatik/Main.java +++ b/src/edu/kit/informatik/cardgame/Main.java @@ -1,6 +1,6 @@ -package edu.kit.informatik; +package edu.kit.informatik.cardgame; -import edu.kit.informatik.ui.CommandLine; +import edu.kit.informatik.cardgame.ui.CommandLine; public final class Main { /** diff --git a/src/edu/kit/informatik/MainTest.java b/src/edu/kit/informatik/cardgame/MainTest.java similarity index 95% rename from src/edu/kit/informatik/MainTest.java rename to src/edu/kit/informatik/cardgame/MainTest.java index 7f5af64..332e52d 100644 --- a/src/edu/kit/informatik/MainTest.java +++ b/src/edu/kit/informatik/cardgame/MainTest.java @@ -1,5 +1,6 @@ -package edu.kit.informatik; +package edu.kit.informatik.cardgame; +import edu.kit.informatik.Terminal; import org.junit.jupiter.api.Test; import java.io.*; diff --git a/src/edu/kit/informatik/model/Card.java b/src/edu/kit/informatik/cardgame/model/Card.java similarity index 98% rename from src/edu/kit/informatik/model/Card.java rename to src/edu/kit/informatik/cardgame/model/Card.java index 0d116eb..4963f89 100644 --- a/src/edu/kit/informatik/model/Card.java +++ b/src/edu/kit/informatik/cardgame/model/Card.java @@ -1,4 +1,4 @@ -package edu.kit.informatik.model; +package edu.kit.informatik.cardgame.model; public enum Card { WOOD, diff --git a/src/edu/kit/informatik/model/CardGame.java b/src/edu/kit/informatik/cardgame/model/CardGame.java similarity index 94% rename from src/edu/kit/informatik/model/CardGame.java rename to src/edu/kit/informatik/cardgame/model/CardGame.java index 15b4bf7..0f1850b 100644 --- a/src/edu/kit/informatik/model/CardGame.java +++ b/src/edu/kit/informatik/cardgame/model/CardGame.java @@ -1,4 +1,4 @@ -package edu.kit.informatik.model; +package edu.kit.informatik.cardgame.model; import java.util.ArrayDeque; import java.util.ArrayList; @@ -10,12 +10,12 @@ import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; -import static edu.kit.informatik.model.Item.BALLON; -import static edu.kit.informatik.model.Item.FIREPLACE; -import static edu.kit.informatik.model.Item.HANG_GLIDER; -import static edu.kit.informatik.model.Item.SAILING_RAFT; -import static edu.kit.informatik.model.Item.SHACK; -import static edu.kit.informatik.model.Item.STEAMBOAT; +import static edu.kit.informatik.cardgame.model.Item.BALLON; +import static edu.kit.informatik.cardgame.model.Item.FIREPLACE; +import static edu.kit.informatik.cardgame.model.Item.HANG_GLIDER; +import static edu.kit.informatik.cardgame.model.Item.SAILING_RAFT; +import static edu.kit.informatik.cardgame.model.Item.SHACK; +import static edu.kit.informatik.cardgame.model.Item.STEAMBOAT; public class CardGame { private Deque cardStack; diff --git a/src/edu/kit/informatik/model/Item.java b/src/edu/kit/informatik/cardgame/model/Item.java similarity index 92% rename from src/edu/kit/informatik/model/Item.java rename to src/edu/kit/informatik/cardgame/model/Item.java index b6c335a..3f3af3d 100644 --- a/src/edu/kit/informatik/model/Item.java +++ b/src/edu/kit/informatik/cardgame/model/Item.java @@ -1,8 +1,8 @@ -package edu.kit.informatik.model; +package edu.kit.informatik.cardgame.model; -import static edu.kit.informatik.model.Card.METAL; -import static edu.kit.informatik.model.Card.PLASTIC; -import static edu.kit.informatik.model.Card.WOOD; +import static edu.kit.informatik.cardgame.model.Card.METAL; +import static edu.kit.informatik.cardgame.model.Card.PLASTIC; +import static edu.kit.informatik.cardgame.model.Card.WOOD; public enum Item { AXE, diff --git a/src/edu/kit/informatik/model/LogicException.java b/src/edu/kit/informatik/cardgame/model/LogicException.java similarity index 74% rename from src/edu/kit/informatik/model/LogicException.java rename to src/edu/kit/informatik/cardgame/model/LogicException.java index a19e5ac..7d1a703 100644 --- a/src/edu/kit/informatik/model/LogicException.java +++ b/src/edu/kit/informatik/cardgame/model/LogicException.java @@ -1,4 +1,4 @@ -package edu.kit.informatik.model; +package edu.kit.informatik.cardgame.model; public class LogicException extends Exception { public LogicException(String message) { diff --git a/src/edu/kit/informatik/ui/CommandLine.java b/src/edu/kit/informatik/cardgame/ui/CommandLine.java similarity index 87% rename from src/edu/kit/informatik/ui/CommandLine.java rename to src/edu/kit/informatik/cardgame/ui/CommandLine.java index 7f014d1..1de445b 100644 --- a/src/edu/kit/informatik/ui/CommandLine.java +++ b/src/edu/kit/informatik/cardgame/ui/CommandLine.java @@ -1,10 +1,10 @@ -package edu.kit.informatik.ui; +package edu.kit.informatik.cardgame.ui; -import edu.kit.informatik.model.CardGame; +import edu.kit.informatik.cardgame.model.CardGame; +import edu.kit.informatik.cardgame.model.LogicException; +import edu.kit.informatik.cardgame.ui.command.Command; +import edu.kit.informatik.cardgame.ui.command.CommandFactory; import edu.kit.informatik.Terminal; -import edu.kit.informatik.model.LogicException; -import edu.kit.informatik.ui.command.Command; -import edu.kit.informatik.ui.command.CommandFactory; import java.util.StringJoiner; import java.util.stream.IntStream; diff --git a/src/edu/kit/informatik/ui/InvalidInputException.java b/src/edu/kit/informatik/cardgame/ui/InvalidInputException.java similarity index 77% rename from src/edu/kit/informatik/ui/InvalidInputException.java rename to src/edu/kit/informatik/cardgame/ui/InvalidInputException.java index 8a3c82f..f0a4aec 100644 --- a/src/edu/kit/informatik/ui/InvalidInputException.java +++ b/src/edu/kit/informatik/cardgame/ui/InvalidInputException.java @@ -1,4 +1,4 @@ -package edu.kit.informatik.ui; +package edu.kit.informatik.cardgame.ui; public class InvalidInputException extends Exception { public InvalidInputException(String message) { diff --git a/src/edu/kit/informatik/ui/command/Build.java b/src/edu/kit/informatik/cardgame/ui/command/Build.java similarity index 74% rename from src/edu/kit/informatik/ui/command/Build.java rename to src/edu/kit/informatik/cardgame/ui/command/Build.java index a71a643..b2c7c38 100644 --- a/src/edu/kit/informatik/ui/command/Build.java +++ b/src/edu/kit/informatik/cardgame/ui/command/Build.java @@ -1,15 +1,15 @@ -package edu.kit.informatik.ui.command; +package edu.kit.informatik.cardgame.ui.command; import edu.kit.informatik.Terminal; -import edu.kit.informatik.model.CardGame; -import edu.kit.informatik.model.Item; -import edu.kit.informatik.model.LogicException; -import edu.kit.informatik.ui.InvalidInputException; +import edu.kit.informatik.cardgame.model.CardGame; +import edu.kit.informatik.cardgame.model.Item; +import edu.kit.informatik.cardgame.model.LogicException; +import edu.kit.informatik.cardgame.ui.InvalidInputException; import java.util.regex.Matcher; import java.util.regex.Pattern; -import static edu.kit.informatik.ui.command.CommandFactory.BUILD; +import static edu.kit.informatik.cardgame.ui.command.CommandFactory.BUILD; public final class Build extends Command { private static final Pattern BUILD_ARGUMENT = Pattern.compile(BUILD + "(\\w+)"); diff --git a/src/edu/kit/informatik/ui/command/Buildable.java b/src/edu/kit/informatik/cardgame/ui/command/Buildable.java similarity index 71% rename from src/edu/kit/informatik/ui/command/Buildable.java rename to src/edu/kit/informatik/cardgame/ui/command/Buildable.java index b3ba6b5..833bf4a 100644 --- a/src/edu/kit/informatik/ui/command/Buildable.java +++ b/src/edu/kit/informatik/cardgame/ui/command/Buildable.java @@ -1,15 +1,15 @@ -package edu.kit.informatik.ui.command; +package edu.kit.informatik.cardgame.ui.command; import edu.kit.informatik.Terminal; -import edu.kit.informatik.model.CardGame; -import edu.kit.informatik.model.Item; -import edu.kit.informatik.model.LogicException; -import edu.kit.informatik.ui.InvalidInputException; +import edu.kit.informatik.cardgame.model.CardGame; +import edu.kit.informatik.cardgame.model.Item; +import edu.kit.informatik.cardgame.model.LogicException; +import edu.kit.informatik.cardgame.ui.InvalidInputException; import java.util.Comparator; import java.util.Set; -import static edu.kit.informatik.ui.command.CommandFactory.BUILDABLE; +import static edu.kit.informatik.cardgame.ui.command.CommandFactory.BUILDABLE; public final class Buildable extends Command { @Override diff --git a/src/edu/kit/informatik/ui/command/Command.java b/src/edu/kit/informatik/cardgame/ui/command/Command.java similarity index 76% rename from src/edu/kit/informatik/ui/command/Command.java rename to src/edu/kit/informatik/cardgame/ui/command/Command.java index f592199..8fe88e2 100644 --- a/src/edu/kit/informatik/ui/command/Command.java +++ b/src/edu/kit/informatik/cardgame/ui/command/Command.java @@ -1,8 +1,8 @@ -package edu.kit.informatik.ui.command; +package edu.kit.informatik.cardgame.ui.command; -import edu.kit.informatik.model.CardGame; -import edu.kit.informatik.model.LogicException; -import edu.kit.informatik.ui.InvalidInputException; +import edu.kit.informatik.cardgame.model.CardGame; +import edu.kit.informatik.cardgame.model.LogicException; +import edu.kit.informatik.cardgame.ui.InvalidInputException; /** * Command that can be applied to a simulation. diff --git a/src/edu/kit/informatik/ui/command/CommandFactory.java b/src/edu/kit/informatik/cardgame/ui/command/CommandFactory.java similarity index 94% rename from src/edu/kit/informatik/ui/command/CommandFactory.java rename to src/edu/kit/informatik/cardgame/ui/command/CommandFactory.java index 3d71b3b..8fc0cdd 100644 --- a/src/edu/kit/informatik/ui/command/CommandFactory.java +++ b/src/edu/kit/informatik/cardgame/ui/command/CommandFactory.java @@ -1,10 +1,9 @@ -package edu.kit.informatik.ui.command; +package edu.kit.informatik.cardgame.ui.command; -import edu.kit.informatik.ui.InvalidInputException; +import edu.kit.informatik.cardgame.ui.InvalidInputException; import java.util.HashMap; import java.util.Map; -import java.util.function.Function; import java.util.function.Supplier; /** diff --git a/src/edu/kit/informatik/ui/command/Draw.java b/src/edu/kit/informatik/cardgame/ui/command/Draw.java similarity index 65% rename from src/edu/kit/informatik/ui/command/Draw.java rename to src/edu/kit/informatik/cardgame/ui/command/Draw.java index 7f7c7b3..6a5a37e 100644 --- a/src/edu/kit/informatik/ui/command/Draw.java +++ b/src/edu/kit/informatik/cardgame/ui/command/Draw.java @@ -1,11 +1,11 @@ -package edu.kit.informatik.ui.command; +package edu.kit.informatik.cardgame.ui.command; import edu.kit.informatik.Terminal; -import edu.kit.informatik.model.CardGame; -import edu.kit.informatik.model.LogicException; -import edu.kit.informatik.ui.InvalidInputException; +import edu.kit.informatik.cardgame.model.CardGame; +import edu.kit.informatik.cardgame.model.LogicException; +import edu.kit.informatik.cardgame.ui.InvalidInputException; -import static edu.kit.informatik.ui.command.CommandFactory.DRAW; +import static edu.kit.informatik.cardgame.ui.command.CommandFactory.DRAW; public final class Draw extends Command { @Override diff --git a/src/edu/kit/informatik/ui/command/ListBuildings.java b/src/edu/kit/informatik/cardgame/ui/command/ListBuildings.java similarity index 70% rename from src/edu/kit/informatik/ui/command/ListBuildings.java rename to src/edu/kit/informatik/cardgame/ui/command/ListBuildings.java index 5db6695..e9b4cf5 100644 --- a/src/edu/kit/informatik/ui/command/ListBuildings.java +++ b/src/edu/kit/informatik/cardgame/ui/command/ListBuildings.java @@ -1,14 +1,14 @@ -package edu.kit.informatik.ui.command; +package edu.kit.informatik.cardgame.ui.command; import edu.kit.informatik.Terminal; -import edu.kit.informatik.model.CardGame; -import edu.kit.informatik.model.Item; -import edu.kit.informatik.model.LogicException; -import edu.kit.informatik.ui.InvalidInputException; +import edu.kit.informatik.cardgame.model.CardGame; +import edu.kit.informatik.cardgame.model.Item; +import edu.kit.informatik.cardgame.model.LogicException; +import edu.kit.informatik.cardgame.ui.InvalidInputException; import java.util.List; -import static edu.kit.informatik.ui.command.CommandFactory.LIST_BUILDINGS; +import static edu.kit.informatik.cardgame.ui.command.CommandFactory.LIST_BUILDINGS; public final class ListBuildings extends Command { @Override diff --git a/src/edu/kit/informatik/ui/command/ListResources.java b/src/edu/kit/informatik/cardgame/ui/command/ListResources.java similarity index 69% rename from src/edu/kit/informatik/ui/command/ListResources.java rename to src/edu/kit/informatik/cardgame/ui/command/ListResources.java index 315644a..4c36480 100644 --- a/src/edu/kit/informatik/ui/command/ListResources.java +++ b/src/edu/kit/informatik/cardgame/ui/command/ListResources.java @@ -1,14 +1,14 @@ -package edu.kit.informatik.ui.command; +package edu.kit.informatik.cardgame.ui.command; import edu.kit.informatik.Terminal; -import edu.kit.informatik.model.Card; -import edu.kit.informatik.model.CardGame; -import edu.kit.informatik.model.LogicException; -import edu.kit.informatik.ui.InvalidInputException; +import edu.kit.informatik.cardgame.model.Card; +import edu.kit.informatik.cardgame.model.CardGame; +import edu.kit.informatik.cardgame.model.LogicException; +import edu.kit.informatik.cardgame.ui.InvalidInputException; import java.util.Deque; -import static edu.kit.informatik.ui.command.CommandFactory.LIST_RESOURCES; +import static edu.kit.informatik.cardgame.ui.command.CommandFactory.LIST_RESOURCES; public final class ListResources extends Command { @Override diff --git a/src/edu/kit/informatik/ui/command/Reset.java b/src/edu/kit/informatik/cardgame/ui/command/Reset.java similarity index 66% rename from src/edu/kit/informatik/ui/command/Reset.java rename to src/edu/kit/informatik/cardgame/ui/command/Reset.java index aa2ca04..04bb390 100644 --- a/src/edu/kit/informatik/ui/command/Reset.java +++ b/src/edu/kit/informatik/cardgame/ui/command/Reset.java @@ -1,11 +1,11 @@ -package edu.kit.informatik.ui.command; +package edu.kit.informatik.cardgame.ui.command; import edu.kit.informatik.Terminal; -import edu.kit.informatik.model.CardGame; -import edu.kit.informatik.model.LogicException; -import edu.kit.informatik.ui.InvalidInputException; +import edu.kit.informatik.cardgame.model.CardGame; +import edu.kit.informatik.cardgame.model.LogicException; +import edu.kit.informatik.cardgame.ui.InvalidInputException; -import static edu.kit.informatik.ui.command.CommandFactory.RESET; +import static edu.kit.informatik.cardgame.ui.command.CommandFactory.RESET; public final class Reset extends Command { @Override diff --git a/src/edu/kit/informatik/ui/command/RollDice.java b/src/edu/kit/informatik/cardgame/ui/command/RollDice.java similarity index 76% rename from src/edu/kit/informatik/ui/command/RollDice.java rename to src/edu/kit/informatik/cardgame/ui/command/RollDice.java index b4f5770..7d334b4 100644 --- a/src/edu/kit/informatik/ui/command/RollDice.java +++ b/src/edu/kit/informatik/cardgame/ui/command/RollDice.java @@ -1,14 +1,14 @@ -package edu.kit.informatik.ui.command; +package edu.kit.informatik.cardgame.ui.command; import edu.kit.informatik.Terminal; -import edu.kit.informatik.model.CardGame; -import edu.kit.informatik.model.LogicException; -import edu.kit.informatik.ui.InvalidInputException; +import edu.kit.informatik.cardgame.model.CardGame; +import edu.kit.informatik.cardgame.model.LogicException; +import edu.kit.informatik.cardgame.ui.InvalidInputException; import java.util.regex.Matcher; import java.util.regex.Pattern; -import static edu.kit.informatik.ui.command.CommandFactory.ROLL_DICE; +import static edu.kit.informatik.cardgame.ui.command.CommandFactory.ROLL_DICE; public final class RollDice extends Command { private static final Pattern ROLL_DICE_ARGUMENTS = Pattern.compile(ROLL_DICE + "(\\d) (\\d)"); diff --git a/src/edu/kit/informatik/ui/command/Start.java b/src/edu/kit/informatik/cardgame/ui/command/Start.java similarity index 90% rename from src/edu/kit/informatik/ui/command/Start.java rename to src/edu/kit/informatik/cardgame/ui/command/Start.java index 087c358..8d76301 100644 --- a/src/edu/kit/informatik/ui/command/Start.java +++ b/src/edu/kit/informatik/cardgame/ui/command/Start.java @@ -1,10 +1,10 @@ -package edu.kit.informatik.ui.command; +package edu.kit.informatik.cardgame.ui.command; import edu.kit.informatik.Terminal; -import edu.kit.informatik.model.Card; -import edu.kit.informatik.model.CardGame; -import edu.kit.informatik.model.LogicException; -import edu.kit.informatik.ui.InvalidInputException; +import edu.kit.informatik.cardgame.model.Card; +import edu.kit.informatik.cardgame.model.CardGame; +import edu.kit.informatik.cardgame.model.LogicException; +import edu.kit.informatik.cardgame.ui.InvalidInputException; import java.util.ArrayDeque; import java.util.Deque;