School Commit Init
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
package Views.Commands;
|
||||
|
||||
public abstract class Command {
|
||||
private String key;
|
||||
private String description;
|
||||
public Command (String key, String description) {
|
||||
this.key = key;
|
||||
this.description = description;
|
||||
}
|
||||
public abstract void execute();
|
||||
public String getKey() {
|
||||
return this.key;
|
||||
}
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package Views.Commands;
|
||||
|
||||
public class ExitCommand extends Command {
|
||||
public ExitCommand(String key, String description) {
|
||||
super(key, description);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package Views.Commands;
|
||||
|
||||
import Controllers.Controller;
|
||||
|
||||
public class RunExampleCommand extends Command {
|
||||
private Controller controller;
|
||||
public RunExampleCommand(String key, String description, Controller controller) {
|
||||
super(key, description);
|
||||
this.controller = controller;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
this.controller.allSteps();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user