From d6eeee7b77238aaa80b1d02165a2da3179196619 Mon Sep 17 00:00:00 2001 From: nkotaa Date: Wed, 13 Mar 2024 15:09:14 +0800 Subject: [PATCH 1/2] Add Skeleton Ui Class --- src/main/java/seedu/binbash/ui/Ui.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/main/java/seedu/binbash/ui/Ui.java diff --git a/src/main/java/seedu/binbash/ui/Ui.java b/src/main/java/seedu/binbash/ui/Ui.java new file mode 100644 index 0000000000..4d7dbd77ba --- /dev/null +++ b/src/main/java/seedu/binbash/ui/Ui.java @@ -0,0 +1,21 @@ +package seedu.binbash.ui; + +import java.util.Scanner; + +public class Ui { + private static final String WELCOME_MESSAGE = "Welcome to BinBash!"; + private static final String GOODBYE_MESSAGE = "Bye!"; + private static final String LINE_DIVIDER = "-------------------------------------------------------------"; + + private Scanner in; + private boolean isUserActive; + + public Ui() { + in = new Scanner(System.in); + isUserActive = true; + } + + public boolean isUserActive() { + return isUserActive; + } +} From 7e6d5e1f8fbbcbc435734313b9836c435add9613 Mon Sep 17 00:00:00 2001 From: nkotaa Date: Wed, 13 Mar 2024 16:04:07 +0800 Subject: [PATCH 2/2] Add Rudimentary Helper Methods --- src/main/java/seedu/binbash/ui/Ui.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/seedu/binbash/ui/Ui.java b/src/main/java/seedu/binbash/ui/Ui.java index 4d7dbd77ba..c1392fdedb 100644 --- a/src/main/java/seedu/binbash/ui/Ui.java +++ b/src/main/java/seedu/binbash/ui/Ui.java @@ -18,4 +18,16 @@ public Ui() { public boolean isUserActive() { return isUserActive; } + + public void greet() { + talk(WELCOME_MESSAGE); + } + + public void farewell() { + talk(GOODBYE_MESSAGE); + } + + public void talk(String line) { + System.out.println(LINE_DIVIDER + "\n" + line + "\n" + LINE_DIVIDER); + } }