Semesterarbeit-1/main/Tools.java

74 lines
1.5 KiB
Java

package minigame;
public class Tools {
public static void printSlow30(String x) {
for (char y : x.toCharArray()) {
System.out.print(y);
try {
Thread.sleep(30);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public static void printSlow15(String x) {
for (char y : x.toCharArray()) {
System.out.print(y);
try {
Thread.sleep(15);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public static void printSlow80(String x) {
for (char y : x.toCharArray()) {
System.out.print(y);
try {
Thread.sleep(80);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public static void printSlow800(String x) {
for (char y : x.toCharArray()) {
System.out.print(y);
try {
Thread.sleep(800);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public static void waitT(int time, String type) {
if (type.equalsIgnoreCase("s")) {
try {
Thread.sleep(time * 1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
} else if (type.equalsIgnoreCase("m")){
try {
Thread.sleep(time);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public static void explainCommand(String com, String info) {
Tools.printSlow30("\nINFO | \"/"+com+"\" - "+info);
}
public static String lineGap() {
return "------------------------------------------------------------------------------------------------------";
}
}