Skip to content
Snippets Groups Projects
Commit 2180d47a authored by Christopher Bohn's avatar Christopher Bohn :thinking:
Browse files

Fixed bug in which two TextUserInterface objects are created

parent a492d9fa
No related branches found
No related tags found
No related merge requests found
......@@ -61,7 +61,7 @@ git commit --author="Herbie Husker <herbie@huskers.unl.edu>"
1. Clone the project: `git clone <URL>` (here the angle brackets should
not be included).
- **Do *NOT* place your car rental system repository inside your
- **Do *NOT* place your petting zoo system repository inside your
csce361-homework repository!**
1. Import the project into your IDE. The project is set up as a Maven
......@@ -632,7 +632,7 @@ requiring any particular number of tests.
For grading, we will clone your copy of the project after it is due, and we
will look for:
- Source code for your car rental system
- Source code for your petting zoo system
- Unit tests for your source code
*It is your responsibility to ensure that your work is in the **correct
......@@ -652,7 +652,7 @@ The assignment is worth **39 points**:
- View subsystem presents information to the user
- **4 points** for implementing the Builder Pattern
- Use the Builder Pattern to create books, which may have specified or
- Use the Builder Pattern to create animals, which may have specified or
default values for their fields
- **4 points** for implementing the Command Pattern
......
package edu.unl.cse.csce361.petting_zoo;
import com.vdurmont.emoji.EmojiParser;
import edu.unl.cse.csce361.petting_zoo.controller.*;
import edu.unl.cse.csce361.petting_zoo.view.textview.TextUserInterface;
import edu.unl.cse.csce361.petting_zoo.view.UserInterface;
import edu.unl.cse.csce361.petting_zoo.view.UserInterfaceManager;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class CLI {
private static final UserInterface ui = new TextUserInterface();
private static final UserInterface ui = UserInterfaceManager.getUI();
// When we later migrate to Java 11, we'll want to use List.of()
public static final List<Command> mainMenu = Collections.unmodifiableList(Arrays.asList(
......
package edu.unl.cse.csce361.petting_zoo.view;
import edu.unl.cse.csce361.petting_zoo.view.javafxview.GraphicalUserInterface;
import edu.unl.cse.csce361.petting_zoo.view.textview.TextUserInterface;
public class UserInterfaceManager {
private static UserInterface ui = null;
......@@ -11,7 +12,8 @@ public class UserInterfaceManager {
public static UserInterface getUI() {
if (ui == null) {
ui = new GraphicalUserInterface(); // TODO: replace with dynamically-chosen UI
ui = new TextUserInterface(); // TODO: replace with dynamically-chosen UI
// ui = new GraphicalUserInterface(); // TODO: replace with dynamically-chosen UI
}
return ui;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment