LanguageTest.java clean code update

This commit is contained in:
Andrin Fassbind 2021-10-09 17:17:59 +02:00
parent 105471350d
commit aeceb51565
1 changed files with 30 additions and 12 deletions

View File

@ -45,7 +45,10 @@ public class Language {
if(outputLanguage.equals(germanShortCut)||outputLanguage.equals(englishShortCut)||outputLanguage.equals(vietnameseShortCut)) {
return true;
}
System.out.println(checkLanguage("Diese Sprache ist nicht zulässig","This Language is not valid","Ngôn ngữ này không được phép"));
System.out.println(checkLanguage(
"Diese Sprache ist nicht zulässig",
"This Language is not valid",
"Ngôn ngữ này không được phép"));
return false;
}
@ -80,7 +83,10 @@ public class Language {
* @param player beinhaltet den Integer, welcher den Spieler representiert.
*/
public void outputWinnerText(int player) {
System.out.println(checkLanguage("Spieler "+player+" hat gewonnen! Gut gespiel!","Player "+player+" won! Well played genius!","Người chơi "+player+" đã thắng. Làm tốt!"));
System.out.println(checkLanguage(
"Spieler "+player+" hat gewonnen! Gut gespiel!",
"Player "+player+" won! Well played genius!",
"Người chơi "+player+" đã thắng. Làm tốt!"));
}
/**
@ -88,7 +94,10 @@ public class Language {
* Diese Methode gibt den Text aus, wenn das Spiel zu ende ist.
*/
public void outputGameOverText(){
System.out.println(checkLanguage("Das Spiel ist zu ende!","The Game has finished!","Trò chơi kết thúc rồi!"));
System.out.println(checkLanguage(
"Das Spiel ist zu ende!",
"The Game has finished!",
"Trò chơi kết thúc rồi!"));
}
/**
@ -96,7 +105,10 @@ public class Language {
* Diese Methode gibt den Text aus, falls es Unentschieden ist.
*/
public void outputTieText(){
System.out.println(checkLanguage("Wir haben keinen Gewinner. Es ist unentschieden","We have no Winner. It's a tie","Chúng tôi không có người chiến thắng."));
System.out.println(checkLanguage(
"Wir haben keinen Gewinner. Es ist unentschieden",
"We have no Winner. It's a tie",
"Chúng tôi không có người chiến thắng."));
}
/**
@ -105,7 +117,10 @@ public class Language {
* @param nextPlayer beinhaltet den Integer, welcher den Spieler representiert.
*/
public void outputNextPlayerText(int nextPlayer){
System.out.println(checkLanguage("Du bist dran "+ nextPlayer,"It's your turn "+nextPlayer,"Đến lượt bạn "+nextPlayer));
System.out.println(checkLanguage(
"Du bist dran "+ nextPlayer,
"It's your turn "+nextPlayer,
"Đến lượt bạn "+nextPlayer));
}
/**
@ -113,7 +128,10 @@ public class Language {
* Diese Methode informiert den Nutzer über eine Konsolenausgabe, falls ein falsches Feld ausgewählt wird.
*/
public void outputWrongFieldSelected(){
System.out.println(checkLanguage("Dieses Feld ist nicht zulässig","This Field is not valid","Trường này không được phép"));
System.out.println(checkLanguage(
"Dieses Feld ist nicht zulässig",
"This Field is not valid",
"Trường này không được phép"));
}
/**