added macro to export perph
This commit is contained in:
@@ -43,6 +43,7 @@ abstract BundleMask(Int) from cc.Colors.Color to cc.Colors.Color {
|
||||
}
|
||||
}
|
||||
|
||||
@:build(macros.Exporter.buildExport())
|
||||
class Redstone implements IPeripheral implements IExportable {
|
||||
public static inline final TYPE_NAME:String = "redstone"; // TODO: there is technically not a type for redstone.
|
||||
|
||||
@@ -89,10 +90,12 @@ class Redstone implements IPeripheral implements IExportable {
|
||||
cc.Redstone.setOutput(this.addr,on);
|
||||
}
|
||||
|
||||
@export("output")
|
||||
public inline function getOutput(): Bool {
|
||||
return cc.Redstone.getOutput(this.addr);
|
||||
}
|
||||
|
||||
@export("input")
|
||||
public inline function getInput(): Bool {
|
||||
return cc.Redstone.getInput(this.addr);
|
||||
}
|
||||
@@ -126,14 +129,4 @@ class Redstone implements IPeripheral implements IExportable {
|
||||
public inline function testBundledInput(mask: Color): Bool {
|
||||
return cc.Redstone.testBundledInput(this.addr,mask);
|
||||
}
|
||||
|
||||
|
||||
public function export():ExportConfig {
|
||||
return {
|
||||
getDelegates: [
|
||||
"input" => (_) -> {return Bool(this.getInput());},
|
||||
"analog" => (_) -> {return Number(this.getAnalogInput());}
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user