Move into own package

This commit is contained in:
Arne Keller 2020-03-11 11:07:48 +01:00
parent 9d1fbc2ffe
commit 627f0f96ab
19 changed files with 74 additions and 74 deletions

View File

@ -3,7 +3,7 @@ while true; do
radamsa -o /tmp/input$$-%n -n 100 ~/Documents/KIT/2019/Prog/final2/*input.txt radamsa -o /tmp/input$$-%n -n 100 ~/Documents/KIT/2019/Prog/final2/*input.txt
for filename in /tmp/input$$-*; do for filename in /tmp/input$$-*; do
echo "exit" >> $filename 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 if [ $? -eq 0 ]; then
echo OK echo OK
else else

View File

@ -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 { public final class Main {
/** /**

View File

@ -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 org.junit.jupiter.api.Test;
import java.io.*; import java.io.*;

View File

@ -1,4 +1,4 @@
package edu.kit.informatik.model; package edu.kit.informatik.cardgame.model;
public enum Card { public enum Card {
WOOD, WOOD,

View File

@ -1,4 +1,4 @@
package edu.kit.informatik.model; package edu.kit.informatik.cardgame.model;
import java.util.ArrayDeque; import java.util.ArrayDeque;
import java.util.ArrayList; import java.util.ArrayList;
@ -10,12 +10,12 @@ import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static edu.kit.informatik.model.Item.BALLON; import static edu.kit.informatik.cardgame.model.Item.BALLON;
import static edu.kit.informatik.model.Item.FIREPLACE; import static edu.kit.informatik.cardgame.model.Item.FIREPLACE;
import static edu.kit.informatik.model.Item.HANG_GLIDER; import static edu.kit.informatik.cardgame.model.Item.HANG_GLIDER;
import static edu.kit.informatik.model.Item.SAILING_RAFT; import static edu.kit.informatik.cardgame.model.Item.SAILING_RAFT;
import static edu.kit.informatik.model.Item.SHACK; import static edu.kit.informatik.cardgame.model.Item.SHACK;
import static edu.kit.informatik.model.Item.STEAMBOAT; import static edu.kit.informatik.cardgame.model.Item.STEAMBOAT;
public class CardGame { public class CardGame {
private Deque<Card> cardStack; private Deque<Card> cardStack;

View File

@ -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.cardgame.model.Card.METAL;
import static edu.kit.informatik.model.Card.PLASTIC; import static edu.kit.informatik.cardgame.model.Card.PLASTIC;
import static edu.kit.informatik.model.Card.WOOD; import static edu.kit.informatik.cardgame.model.Card.WOOD;
public enum Item { public enum Item {
AXE, AXE,

View File

@ -1,4 +1,4 @@
package edu.kit.informatik.model; package edu.kit.informatik.cardgame.model;
public class LogicException extends Exception { public class LogicException extends Exception {
public LogicException(String message) { public LogicException(String message) {

View File

@ -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.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.StringJoiner;
import java.util.stream.IntStream; import java.util.stream.IntStream;

View File

@ -1,4 +1,4 @@
package edu.kit.informatik.ui; package edu.kit.informatik.cardgame.ui;
public class InvalidInputException extends Exception { public class InvalidInputException extends Exception {
public InvalidInputException(String message) { public InvalidInputException(String message) {

View File

@ -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.Terminal;
import edu.kit.informatik.model.CardGame; import edu.kit.informatik.cardgame.model.CardGame;
import edu.kit.informatik.model.Item; import edu.kit.informatik.cardgame.model.Item;
import edu.kit.informatik.model.LogicException; import edu.kit.informatik.cardgame.model.LogicException;
import edu.kit.informatik.ui.InvalidInputException; import edu.kit.informatik.cardgame.ui.InvalidInputException;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; 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 { public final class Build extends Command {
private static final Pattern BUILD_ARGUMENT = Pattern.compile(BUILD + "(\\w+)"); private static final Pattern BUILD_ARGUMENT = Pattern.compile(BUILD + "(\\w+)");

View File

@ -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.Terminal;
import edu.kit.informatik.model.CardGame; import edu.kit.informatik.cardgame.model.CardGame;
import edu.kit.informatik.model.Item; import edu.kit.informatik.cardgame.model.Item;
import edu.kit.informatik.model.LogicException; import edu.kit.informatik.cardgame.model.LogicException;
import edu.kit.informatik.ui.InvalidInputException; import edu.kit.informatik.cardgame.ui.InvalidInputException;
import java.util.Comparator; import java.util.Comparator;
import java.util.Set; 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 { public final class Buildable extends Command {
@Override @Override

View File

@ -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.cardgame.model.CardGame;
import edu.kit.informatik.model.LogicException; import edu.kit.informatik.cardgame.model.LogicException;
import edu.kit.informatik.ui.InvalidInputException; import edu.kit.informatik.cardgame.ui.InvalidInputException;
/** /**
* Command that can be applied to a simulation. * Command that can be applied to a simulation.

View File

@ -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.HashMap;
import java.util.Map; import java.util.Map;
import java.util.function.Function;
import java.util.function.Supplier; import java.util.function.Supplier;
/** /**

View File

@ -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.Terminal;
import edu.kit.informatik.model.CardGame; import edu.kit.informatik.cardgame.model.CardGame;
import edu.kit.informatik.model.LogicException; import edu.kit.informatik.cardgame.model.LogicException;
import edu.kit.informatik.ui.InvalidInputException; 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 { public final class Draw extends Command {
@Override @Override

View File

@ -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.Terminal;
import edu.kit.informatik.model.CardGame; import edu.kit.informatik.cardgame.model.CardGame;
import edu.kit.informatik.model.Item; import edu.kit.informatik.cardgame.model.Item;
import edu.kit.informatik.model.LogicException; import edu.kit.informatik.cardgame.model.LogicException;
import edu.kit.informatik.ui.InvalidInputException; import edu.kit.informatik.cardgame.ui.InvalidInputException;
import java.util.List; 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 { public final class ListBuildings extends Command {
@Override @Override

View File

@ -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.Terminal;
import edu.kit.informatik.model.Card; import edu.kit.informatik.cardgame.model.Card;
import edu.kit.informatik.model.CardGame; import edu.kit.informatik.cardgame.model.CardGame;
import edu.kit.informatik.model.LogicException; import edu.kit.informatik.cardgame.model.LogicException;
import edu.kit.informatik.ui.InvalidInputException; import edu.kit.informatik.cardgame.ui.InvalidInputException;
import java.util.Deque; 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 { public final class ListResources extends Command {
@Override @Override

View File

@ -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.Terminal;
import edu.kit.informatik.model.CardGame; import edu.kit.informatik.cardgame.model.CardGame;
import edu.kit.informatik.model.LogicException; import edu.kit.informatik.cardgame.model.LogicException;
import edu.kit.informatik.ui.InvalidInputException; 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 { public final class Reset extends Command {
@Override @Override

View File

@ -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.Terminal;
import edu.kit.informatik.model.CardGame; import edu.kit.informatik.cardgame.model.CardGame;
import edu.kit.informatik.model.LogicException; import edu.kit.informatik.cardgame.model.LogicException;
import edu.kit.informatik.ui.InvalidInputException; import edu.kit.informatik.cardgame.ui.InvalidInputException;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; 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 { public final class RollDice extends Command {
private static final Pattern ROLL_DICE_ARGUMENTS = Pattern.compile(ROLL_DICE + "(\\d) (\\d)"); private static final Pattern ROLL_DICE_ARGUMENTS = Pattern.compile(ROLL_DICE + "(\\d) (\\d)");

View File

@ -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.Terminal;
import edu.kit.informatik.model.Card; import edu.kit.informatik.cardgame.model.Card;
import edu.kit.informatik.model.CardGame; import edu.kit.informatik.cardgame.model.CardGame;
import edu.kit.informatik.model.LogicException; import edu.kit.informatik.cardgame.model.LogicException;
import edu.kit.informatik.ui.InvalidInputException; import edu.kit.informatik.cardgame.ui.InvalidInputException;
import java.util.ArrayDeque; import java.util.ArrayDeque;
import java.util.Deque; import java.util.Deque;