-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "PR containing basic UI code and some basic package st…
…ructure""
- Loading branch information
1 parent
52487d7
commit 82dd730
Showing
14 changed files
with
151 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
/.idea/ | ||
/out/ | ||
/*.iml | ||
/*.class | ||
|
||
# Gradle build files | ||
/.gradle/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ test { | |
} | ||
|
||
application { | ||
mainClass = "seedu.duke.Duke" | ||
mainClass = "Inka" | ||
} | ||
|
||
shadowJar { | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import utils.parser.Parser; | ||
import utils.userinterface.UserInterface; | ||
|
||
public class Inka { | ||
private final UserInterface ui; | ||
private final Parser parser; | ||
public Inka() { | ||
ui = new UserInterface(); | ||
parser = new Parser(); | ||
} | ||
|
||
public void run() { | ||
ui.printGreeting(); | ||
|
||
//fill in the method here | ||
//while(parser.getIsExecuting()) { | ||
// String fullCommand = ui.getCommand(); | ||
//} | ||
|
||
ui.printBye(); | ||
} | ||
|
||
public static void main(String[] args) { | ||
new Inka().run(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package model.card; | ||
|
||
//to be made into an abstract class containing a few types of Cards later, for now just a single Card will do | ||
public class Card { | ||
private int uuid ; //to be made into a hash later | ||
private String question; | ||
private String answer; | ||
|
||
//implement method such as toPrint() or any other appropriate method here | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package model.cardlist; | ||
|
||
import model.card.Card; | ||
import java.util.ArrayList; | ||
|
||
public class CardList { | ||
private ArrayList<Card> cards ; | ||
|
||
CardList() { | ||
this.cards = new ArrayList<>(); | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package utils.enums; | ||
|
||
public enum StringArt { | ||
INKA( | ||
".___ __ \n" + | ||
"| | ____ | | _______ \n" + | ||
"| |/ \\| |/ /\\__ \\ \n" + | ||
"| | | \\ < / __ \\_\n" + | ||
"|___|___| /__|_ \\(____ /\n" + | ||
" \\/ \\/ \\/ "), | ||
BYE( | ||
" ____ _ _ ____ _ \n" + | ||
"( _ \\( \\/ )( __) / \\ \n" + | ||
" ) _ ( ) / ) _) \\_/ \n" + | ||
"(____/(__/ (____) (_) " | ||
); | ||
|
||
public final String art; | ||
StringArt(String art) { | ||
this.art = art; | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package utils.parser; | ||
|
||
public class Parser { | ||
private boolean isExecuting; | ||
|
||
public Parser() { | ||
this.isExecuting = true; | ||
} | ||
|
||
public boolean getIsExecuting() { | ||
return isExecuting; | ||
} | ||
|
||
//add all parser methods here | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package utils.userinterface; | ||
|
||
import utils.enums.StringArt; | ||
|
||
import java.util.Scanner; | ||
|
||
public class UserInterface { | ||
private static final int LINE_LENGTH = 100; | ||
private static final String INKA_ART = | ||
".___ __ \n" + | ||
"| | ____ | | _______ \n" + | ||
"| |/ \\| |/ /\\__ \\ \n" + | ||
"| | | \\ < / __ \\_\n" + | ||
"|___|___| /__|_ \\(____ /\n" + | ||
" \\/ \\/ \\/ "; | ||
|
||
private static final String BYE_ART = | ||
" ____ _ _ ____ _ \n" + | ||
"( _ \\( \\/ )( __) / \\ \n" + | ||
" ) _ ( ) / ) _) \\_/ \n" + | ||
"(____/(__/ (____) (_) "; | ||
private final Scanner scanner; | ||
public UserInterface() { | ||
scanner = new Scanner(System.in); | ||
} | ||
|
||
public String getCommand() { | ||
return scanner.nextLine(); | ||
} | ||
|
||
public void printLine() { | ||
System.out.println("_".repeat(LINE_LENGTH)); | ||
} | ||
|
||
public void printGreeting() { | ||
printLine(); | ||
System.out.println(StringArt.INKA.art); | ||
System.out.println("Welcome to Inka ! Say no more to failing exams as Inka will be your lord and saviour!"); | ||
printLine(); | ||
} | ||
|
||
public void printBye() { | ||
printLine(); | ||
System.out.println(StringArt.BYE.art); | ||
System.out.println("\n Bye! All the best for your exams man!!!"); | ||
printLine(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
Hello from | ||
____ _ | ||
| _ \ _ _| | _____ | ||
| | | | | | | |/ / _ \ | ||
| |_| | |_| | < __/ | ||
|____/ \__,_|_|\_\___| | ||
____________________________________________________________________________________________________ | ||
.___ __ | ||
| | ____ | | _______ | ||
| |/ \| |/ /\__ \ | ||
| | | \ < / __ \_ | ||
|___|___| /__|_ \(____ / | ||
\/ \/ \/ | ||
Welcome to Inka ! Say no more to failing exams as Inka will be your lord and saviour! | ||
____________________________________________________________________________________________________ | ||
____________________________________________________________________________________________________ | ||
____ _ _ ____ _ | ||
( _ \( \/ )( __) / \ | ||
) _ ( ) / ) _) \_/ | ||
(____/(__/ (____) (_) | ||
|
||
What is your name? | ||
Hello James Gosling | ||
Bye! All the best for your exams man!!! | ||
____________________________________________________________________________________________________ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
James Gosling | ||