armory/Sources/armory/logicnode/ArrayBooleanNode.hx

28 lines
486 B
Haxe
Raw Normal View History

2017-04-08 00:34:45 +02:00
package armory.logicnode;
2017-04-08 20:05:35 +02:00
class ArrayBooleanNode extends LogicNode {
2017-04-08 00:34:45 +02:00
2019-12-19 23:54:08 +01:00
public var value: Array<Bool> = [];
2017-04-08 00:34:45 +02:00
var initialized = false;
2019-12-19 23:54:08 +01:00
public function new(tree: LogicTree) {
2017-04-08 00:34:45 +02:00
super(tree);
}
2019-12-19 23:54:08 +01:00
override function get(from: Int): Dynamic {
2017-04-08 00:34:45 +02:00
if (!initialized) {
initialized = true;
for (inp in inputs) {
2019-12-19 23:54:08 +01:00
var val: Bool = inp.get();
2017-04-08 00:34:45 +02:00
value.push(val);
}
}
return from == 0 ? value : value.length;
}
2019-12-19 23:54:08 +01:00
override function set(value: Dynamic) {
2017-04-08 00:34:45 +02:00
this.value = value;
}
}