make controller a required property of ArchiveUI

This commit is contained in:
2021-10-12 13:45:02 -06:00
parent a1ec7d19c3
commit a4a59f0d40
5 changed files with 4 additions and 13 deletions

View File

@@ -149,7 +149,7 @@
:Map<String,Command> commands (new Map) :Map<String,Command> commands (new Map)
:NameSystem nameSystem (new NameSystem)] :NameSystem nameSystem (new NameSystem)]
(ui.setController this) (set ui.controller this)
// Add systems! // Add systems!
(archive.addSystem nameSystem) (archive.addSystem nameSystem)

View File

@@ -4,9 +4,9 @@ import nat.ArchiveController;
interface ArchiveUI { interface ArchiveUI {
/** /**
* Accept and store a reference to the controller * Reference to the ArchiveController
*/ */
function setController(controller:ArchiveController):Void; var controller(default, default):ArchiveController;
/** /**
* Prompt the user to enter text * Prompt the user to enter text

View File

@@ -14,8 +14,6 @@
(prop &mut :ArchiveController controller) (prop &mut :ArchiveController controller)
(method :Void setController [controller] (set this.controller controller))
(defNew []) (defNew [])
(method :Void enterText [prompt resolve maxLength] (method :Void enterText [prompt resolve maxLength]

View File

@@ -4,14 +4,10 @@ import nat.*;
import nat.ArchiveController.ChangeSet; import nat.ArchiveController.ChangeSet;
class DummyUI implements ArchiveUI { class DummyUI implements ArchiveUI {
var controller:ArchiveController = null; public var controller:ArchiveController = null;
public function new() {} public function new() {}
public function setController(controller:ArchiveController) {
this.controller = controller;
}
public function enterText(prompt:String, resolve:(String) -> Void, maxLength:Float) { public function enterText(prompt:String, resolve:(String) -> Void, maxLength:Float) {
// TODO for proper testing, this will need to resolve with specific pre-coded strings // TODO for proper testing, this will need to resolve with specific pre-coded strings
resolve(""); resolve("");

View File

@@ -105,9 +105,6 @@
(prop &mut :ArchiveController controller) (prop &mut :ArchiveController controller)
(prop &mut :Archive archive) (prop &mut :Archive archive)
(method :Void setController [controller]
(set this.controller controller))
(prop &mut :FlxText textInputLabel null) (prop &mut :FlxText textInputLabel null)
(prop &mut :FlxInputText textInput null) (prop &mut :FlxInputText textInput null)