corrections in output texts

added separator after language change
This commit is contained in:
schrom01 2021-10-15 08:24:21 +02:00
parent 796d17bb43
commit cb29be6204
4 changed files with 32 additions and 5 deletions

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>

View File

@ -79,6 +79,7 @@ public class Game {
* @param language Spielsprache welche zur Verfügung stehen "de","en","vn" * @param language Spielsprache welche zur Verfügung stehen "de","en","vn"
*/ */
public void changeLanguage(String language) { public void changeLanguage(String language) {
this.gamefield.outputSeparator();
this.language.setOutputLanguage(language); this.language.setOutputLanguage(language);
} }

View File

@ -52,9 +52,9 @@ public class Language {
return true; return true;
} }
System.out.println(checkLanguage( System.out.println(checkLanguage(
"Diese Sprache ist nicht zulässig", "Diese Sprache ist nicht zulässig.",
"This Language is not valid", "This language is not valid.",
"Ngôn ngữ này không được phép")); "Ngôn ngữ này không được phép."));
return false; return false;
} }
@ -78,8 +78,8 @@ public class Language {
public void outputMoveText(int move, int player) { public void outputMoveText(int move, int player) {
System.out.println(checkLanguage( System.out.println(checkLanguage(
"Spiezug: " + move + ", Spieler " + player + " spielt.", "Spiezug: " + move + ", Spieler " + player + " spielt.",
"Move: " + move + ", Player " + player + "plays", "Move: " + move + ", Player " + player + " plays.",
"Di chuyển: " + move + ", Người " + player + " chơi" "Di chuyển: " + move + ", Người " + player + " chơi."
)); ));
} }

View File

@ -216,4 +216,20 @@ class GameTest {
} }
@Test
public void changeLanguage() {
Game game = new Game();
game.placeField(1);
game.changeLanguage("en");
game.placeField(3);
game.placeField(2);
game.changeLanguage("vn");
game.placeField(5);
game.placeField(4);
game.changeLanguage("de");
game.placeField(7);
}
} }