From bc5d20e5c9ece8284b364924975fe23f2e6e744a Mon Sep 17 00:00:00 2001 From: mipet23 Date: Sun, 12 Dec 2021 19:51:50 +0100 Subject: [PATCH] Umbenennung Deutsch --> Englisch --- .../kryptojagd/fileprocessing/ReadJSON.java | 4 -- src/main/java/org/kryptojagd/level/Level.java | 38 +------------------ .../level/tasks/DecryptionTask.java | 11 +----- .../level/tasks/EncryptionTask.java | 11 +----- .../level/tasks/MultipleChoiceTask.java | 32 ++-------------- .../java/org/kryptojagd/level/tasks/Task.java | 3 -- .../java/org/kryptojagd/level/LevelTest.java | 2 +- 7 files changed, 8 insertions(+), 93 deletions(-) diff --git a/src/main/java/org/kryptojagd/fileprocessing/ReadJSON.java b/src/main/java/org/kryptojagd/fileprocessing/ReadJSON.java index ced9fd6..ef41cd0 100644 --- a/src/main/java/org/kryptojagd/fileprocessing/ReadJSON.java +++ b/src/main/java/org/kryptojagd/fileprocessing/ReadJSON.java @@ -11,14 +11,10 @@ import com.google.gson.Gson; -<<<<<<< HEAD:src/main/java/org/kryptojagd/fileprocessing/ReadJSON.java import org.kryptojagd.level.DecryptionTask; import org.kryptojagd.level.MultipleChoiceQuestion; public class ReadJSON { -======= -public class AufgabenEinlesen { ->>>>>>> 720278078edb37aa760bdf7d21f5ca5bec41b96c:src/main/java/org/kryptojagd/dateiverarbeitung/AufgabenEinlesen.java // gibt Mul public static MultipleChoiceQuestion createMultiChoiceQuestion() { diff --git a/src/main/java/org/kryptojagd/level/Level.java b/src/main/java/org/kryptojagd/level/Level.java index a485200..dc486a2 100644 --- a/src/main/java/org/kryptojagd/level/Level.java +++ b/src/main/java/org/kryptojagd/level/Level.java @@ -7,48 +7,14 @@ import java.util.LinkedList; -/** - * The class describes a level in the game - * - * @author Sonja - */ public class Level { - private final LinkedList level = new LinkedList<>(); - private Task currentTask; - - /** - * Creates a {@link Level} - * - * @param decryptionTask first task in level is a decryptionTask - * @param encryptionTask second task in level is a encryptionTask - * @param multipleChoiceTask third and last task is a Collection of multiple choice questions - */ + private LinkedList level = new LinkedList<>(); + public Level(DecryptionTask decryptionTask, EncryptionTask encryptionTask, MultipleChoiceTask multipleChoiceTask) { level.add(decryptionTask); level.add(encryptionTask); level.add(multipleChoiceTask); - this.currentTask = level.getFirst(); - } - - /** - * Gives the next Task in the chronology of the level - * - * @return the current task in level - */ - public Task giveNextTask() { - currentTask = level.iterator().next(); - return currentTask; - } - - /** - * Checks the answer to the current task - * - * @param answer the answer which is given - * @return trur, if the answer is correct - */ - public boolean proofCurrentTask(String answer) { - return currentTask.proofAnswer(answer); } } diff --git a/src/main/java/org/kryptojagd/level/tasks/DecryptionTask.java b/src/main/java/org/kryptojagd/level/tasks/DecryptionTask.java index 5ed9802..b5be806 100644 --- a/src/main/java/org/kryptojagd/level/tasks/DecryptionTask.java +++ b/src/main/java/org/kryptojagd/level/tasks/DecryptionTask.java @@ -2,20 +2,11 @@ import org.kryptojagd.encryptionmethods.Encryption; -/** - * The class describes a task, where you have to decrypt text - * - * @author Sonja - */ + public class DecryptionTask implements Task { private Encryption encryption; - /** - * Creates a {@link DecryptionTask} - * - * @param encryption the encryption, in which you have to decrypt the text - */ public DecryptionTask(Encryption encryption) { this.encryption = encryption; } diff --git a/src/main/java/org/kryptojagd/level/tasks/EncryptionTask.java b/src/main/java/org/kryptojagd/level/tasks/EncryptionTask.java index bda855e..ac3a2e2 100644 --- a/src/main/java/org/kryptojagd/level/tasks/EncryptionTask.java +++ b/src/main/java/org/kryptojagd/level/tasks/EncryptionTask.java @@ -2,20 +2,11 @@ import org.kryptojagd.encryptionmethods.Encryption; -/** - * The class describes a task, where you have to encrypt text - * - * @author Sonja - */ + public class EncryptionTask implements Task { private Encryption encryption; - /** - * Creates a {@link EncryptionTask} - * - * @param encryption the encryption, in which you have to encrypt the text - */ public EncryptionTask(Encryption encryption) { this.encryption = encryption; } diff --git a/src/main/java/org/kryptojagd/level/tasks/MultipleChoiceTask.java b/src/main/java/org/kryptojagd/level/tasks/MultipleChoiceTask.java index 132cb4e..86dded9 100644 --- a/src/main/java/org/kryptojagd/level/tasks/MultipleChoiceTask.java +++ b/src/main/java/org/kryptojagd/level/tasks/MultipleChoiceTask.java @@ -1,40 +1,14 @@ package org.kryptojagd.level.tasks; -import org.kryptojagd.level.Level; +import java.util.HashMap; -/** - * The class describes a task, where you have to answer multiple choice questions - * - * @author Sonja - */ public class MultipleChoiceTask implements Task { - private String question; - private String answer; - private String[] possibilities; - - /** - * Creates a {@link MultipleChoiceTask} - * - * @param question the question, which you have to answer - * @param answer the right answer of the question - * @param possibilities the possibilities to answer - */ - public MultipleChoiceTask(String question, String answer, String[] possibilities) { - this.question = question; - this.answer = answer; - this.possibilities = possibilities; + public MultipleChoiceTask(HashMap input) { } @Override public boolean proofAnswer(String answer) { - return this.answer.equals(answer); + return false; } - - @Override - public String toString() { - String multipleChoice = ""; - return multipleChoice; - } - } diff --git a/src/main/java/org/kryptojagd/level/tasks/Task.java b/src/main/java/org/kryptojagd/level/tasks/Task.java index 8fc1199..2a5fb54 100644 --- a/src/main/java/org/kryptojagd/level/tasks/Task.java +++ b/src/main/java/org/kryptojagd/level/tasks/Task.java @@ -1,10 +1,7 @@ package org.kryptojagd.level.tasks; -<<<<<<< HEAD import org.kryptojagd.encryptionmethods.Encryption; -======= ->>>>>>> 720278078edb37aa760bdf7d21f5ca5bec41b96c /** * The interface describes the form of a task in the game * diff --git a/src/test/java/org/kryptojagd/level/LevelTest.java b/src/test/java/org/kryptojagd/level/LevelTest.java index 584c3fc..d8a5323 100644 --- a/src/test/java/org/kryptojagd/level/LevelTest.java +++ b/src/test/java/org/kryptojagd/level/LevelTest.java @@ -5,7 +5,7 @@ import org.kryptojagd.level.tasks.DecryptionTask; import org.kryptojagd.level.tasks.EncryptionTask; import org.kryptojagd.level.tasks.MultipleChoiceTask; -import org.kryptojagd.verschluesselungsverfahren.Caesar; +import org.kryptojagd.encryptionmethods.Caesar; import static org.junit.jupiter.api.Assertions.*;