added export to Redstone
This commit is contained in:
parent
e686afb298
commit
909aac941c
@ -1,5 +1,7 @@
|
||||
package kernel.peripherals;
|
||||
|
||||
import lib.exporter.ExportConfig;
|
||||
import lib.exporter.IExportable;
|
||||
import haxe.ds.ReadOnlyArray;
|
||||
import lib.Color;
|
||||
|
||||
@ -41,7 +43,7 @@ abstract BundleMask(Int) from cc.Colors.Color to cc.Colors.Color {
|
||||
}
|
||||
}
|
||||
|
||||
class Redstone implements IPeripheral {
|
||||
class Redstone implements IPeripheral implements IExportable {
|
||||
|
||||
public final onChange:Signal<Noise>;
|
||||
|
||||
@ -120,4 +122,14 @@ class Redstone implements IPeripheral {
|
||||
return cc.Redstone.testBundledInput(this.addr,mask);
|
||||
}
|
||||
|
||||
|
||||
public function export():ExportConfig {
|
||||
return {
|
||||
type: "redstone",
|
||||
getDelegates: [
|
||||
"input" => (_) -> {return Bool(this.getInput());},
|
||||
"analog" => (_) -> {return Number(this.getAnalogInput());}
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user