IntegerNode.hx 480 B

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