package main.java.ui;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class UserInput {
    public static String get (String msg) {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            System.out.println("\n" + msg);
            System.out.print("Input: ");
            return br.readLine();
        } catch (IOException e){
            return null;
        }
    }

    public static void badInput() {
        try {
            System.out.println("\nInvalid input!");
            Thread.sleep(500);
        } catch (InterruptedException e){
            e.printStackTrace();
        }
    }

    public static void success(boolean s) {
        if (s)
            System.out.println("Success");
        else
            System.out.println("Operation unsuccessful, please try again");
        try {
            Thread.sleep(500);
        } catch (InterruptedException e){
            e.printStackTrace();
        }
    }
}
