StringNode.hx 462 B

123456789101112131415161718192021222324
  1. package arm.logic;
  2. import arm.logic.LogicNode;
  3. @:keep
  4. class StringNode extends LogicNode {
  5. public var value: String;
  6. public function new(tree: LogicTree, value = "") {
  7. super(tree);
  8. this.value = value;
  9. }
  10. override function get(from: Int, done: Dynamic->Void) {
  11. if (inputs.length > 0) inputs[0].get(done);
  12. else done(value);
  13. }
  14. override function set(value: Dynamic) {
  15. if (inputs.length > 0) inputs[0].set(value);
  16. else this.value = value;
  17. }
  18. }