Reorganize code

This commit is contained in:
Arne Keller 2020-02-16 15:01:33 +01:00
parent bfccc89237
commit 9aa8cc2384
37 changed files with 79 additions and 64 deletions

View File

@ -1,4 +1,6 @@
package edu.kit.informatik; package edu.kit.informatik.model;
import edu.kit.informatik.ui.CoachType;
/** /**
* A coach. * A coach.

View File

@ -1,4 +1,4 @@
package edu.kit.informatik; package edu.kit.informatik.model;
/** /**
* Diesel engine. * Diesel engine.

View File

@ -1,4 +1,4 @@
package edu.kit.informatik; package edu.kit.informatik.model;
/** /**
* Electrical engine. * Electrical engine.

View File

@ -1,4 +1,4 @@
package edu.kit.informatik; package edu.kit.informatik.model;
/** /**
* Generic engine, is usually either diesel, steam or electric. * Generic engine, is usually either diesel, steam or electric.

View File

@ -1,4 +1,7 @@
package edu.kit.informatik; package edu.kit.informatik.model;
import edu.kit.informatik.ui.CoachType;
import edu.kit.informatik.Terminal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;

View File

@ -1,4 +1,4 @@
package edu.kit.informatik; package edu.kit.informatik.model;
/** /**
* Generic rail that other rails can connect to. * Generic rail that other rails can connect to.

View File

@ -1,4 +1,4 @@
package edu.kit.informatik; package edu.kit.informatik.model;
/** /**
* A rolling stock. Is usually an engine, train set or coach. * A rolling stock. Is usually an engine, train set or coach.

View File

@ -1,4 +1,4 @@
package edu.kit.informatik; package edu.kit.informatik.model;
/** /**
* Steam engine. * Steam engine.

View File

@ -1,4 +1,4 @@
package edu.kit.informatik; package edu.kit.informatik.model;
import java.util.Objects; import java.util.Objects;

View File

@ -1,4 +1,4 @@
package edu.kit.informatik; package edu.kit.informatik.model;
import java.util.Objects; import java.util.Objects;

View File

@ -1,4 +1,6 @@
package edu.kit.informatik; package edu.kit.informatik.model;
import edu.kit.informatik.Terminal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@ -1,4 +1,4 @@
package edu.kit.informatik; package edu.kit.informatik.model;
/** /**
* Train set. * Train set.

View File

@ -1,4 +1,4 @@
package edu.kit.informatik; package edu.kit.informatik.model;
import java.util.Objects; import java.util.Objects;

View File

@ -1,4 +1,4 @@
package edu.kit.informatik; package edu.kit.informatik.ui;
/** /**
* Type of a coach. * Type of a coach.

View File

@ -1,7 +1,9 @@
package edu.kit.informatik; package edu.kit.informatik.ui;
import edu.kit.informatik.command.Command; import edu.kit.informatik.model.ModelRailwaySimulation;
import edu.kit.informatik.command.CommandFactory; import edu.kit.informatik.Terminal;
import edu.kit.informatik.ui.command.Command;
import edu.kit.informatik.ui.command.CommandFactory;
/** /**
* Interactive simulation runner, gets user inputs and processes commands specified. * Interactive simulation runner, gets user inputs and processes commands specified.

View File

@ -1,4 +1,4 @@
package edu.kit.informatik; package edu.kit.informatik.ui;
/** /**
* Type of locomotive. Can be either diesel, steam or electrical. * Type of locomotive. Can be either diesel, steam or electrical.

View File

@ -1,4 +1,4 @@
package edu.kit.informatik; package edu.kit.informatik.ui;
/** /**
* Thrown on invalid user input. * Thrown on invalid user input.

View File

@ -1,7 +1,7 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
import edu.kit.informatik.Vector2D; import edu.kit.informatik.model.Vector2D;
import edu.kit.informatik.Terminal; import edu.kit.informatik.Terminal;
/** /**

View File

@ -1,7 +1,7 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
import edu.kit.informatik.Vector2D; import edu.kit.informatik.model.Vector2D;
import edu.kit.informatik.Terminal; import edu.kit.informatik.Terminal;
/** /**

View File

@ -1,7 +1,7 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
import edu.kit.informatik.RollingStock; import edu.kit.informatik.model.RollingStock;
import edu.kit.informatik.Terminal; import edu.kit.informatik.Terminal;
/** /**

View File

@ -1,6 +1,6 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
/** /**
* Command that can be applied to a simulation. * Command that can be applied to a simulation.

View File

@ -1,6 +1,10 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.*; import edu.kit.informatik.*;
import edu.kit.informatik.model.Vector2D;
import edu.kit.informatik.ui.CoachType;
import edu.kit.informatik.ui.EngineType;
import edu.kit.informatik.ui.InvalidInputException;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;

View File

@ -1,7 +1,7 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.CoachType; import edu.kit.informatik.ui.CoachType;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
import edu.kit.informatik.Terminal; import edu.kit.informatik.Terminal;
/** /**

View File

@ -1,6 +1,8 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.*; import edu.kit.informatik.*;
import edu.kit.informatik.model.*;
import edu.kit.informatik.ui.EngineType;
/** /**
* Command used to create a single engine. * Command used to create a single engine.

View File

@ -1,8 +1,8 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
import edu.kit.informatik.Terminal; import edu.kit.informatik.Terminal;
import edu.kit.informatik.TrainSet; import edu.kit.informatik.model.TrainSet;
/** /**
* Command used to add a new train set. * Command used to add a new train set.

View File

@ -1,6 +1,6 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
import edu.kit.informatik.Terminal; import edu.kit.informatik.Terminal;
/** /**

View File

@ -1,6 +1,6 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
import edu.kit.informatik.Terminal; import edu.kit.informatik.Terminal;
/** /**

View File

@ -1,6 +1,6 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
import edu.kit.informatik.Terminal; import edu.kit.informatik.Terminal;
/** /**

View File

@ -1,6 +1,6 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
/** /**
* Command used to print a list of coaches. * Command used to print a list of coaches.

View File

@ -1,6 +1,6 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
/** /**
* Command used to print a list of engines. * Command used to print a list of engines.

View File

@ -1,6 +1,6 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
/** /**
* Command used to print a list of tracks and switches. * Command used to print a list of tracks and switches.

View File

@ -1,6 +1,6 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
/** /**
* Command used to print a list of train sets on the terminal. * Command used to print a list of train sets on the terminal.

View File

@ -1,6 +1,6 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
/** /**
* Command used to print a list of trains on the terminal. * Command used to print a list of trains on the terminal.

View File

@ -1,7 +1,7 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
import edu.kit.informatik.Vector2D; import edu.kit.informatik.model.Vector2D;
import edu.kit.informatik.Terminal; import edu.kit.informatik.Terminal;
/** /**

View File

@ -1,7 +1,7 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
import edu.kit.informatik.Vector2D; import edu.kit.informatik.model.Vector2D;
import edu.kit.informatik.Terminal; import edu.kit.informatik.Terminal;
/** /**

View File

@ -1,6 +1,6 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
/** /**
* Command used to print a train as ASCII art. * Command used to print a train as ASCII art.

View File

@ -1,6 +1,6 @@
package edu.kit.informatik.command; package edu.kit.informatik.ui.command;
import edu.kit.informatik.ModelRailwaySimulation; import edu.kit.informatik.model.ModelRailwaySimulation;
/** /**
* Command used to advance the simulation. * Command used to advance the simulation.