added type to IPerph
This commit is contained in:
@@ -44,6 +44,7 @@ abstract BundleMask(Int) from cc.Colors.Color to cc.Colors.Color {
|
||||
}
|
||||
|
||||
class Redstone implements IPeripheral implements IExportable {
|
||||
public static inline final TYPE_NAME:String = "redstone"; // TODO: there is technically not a type for redstone.
|
||||
|
||||
public final onChange:Signal<Noise>;
|
||||
|
||||
@@ -74,6 +75,10 @@ class Redstone implements IPeripheral implements IExportable {
|
||||
return this.addr;
|
||||
}
|
||||
|
||||
public function getType():String {
|
||||
return TYPE_NAME;
|
||||
}
|
||||
|
||||
private function updateState() {
|
||||
this.analogInputState = cc.Redstone.getAnalogInput(this.addr);
|
||||
this.bundleInputState = cc.Redstone.getBundledInput(this.addr);
|
||||
@@ -125,7 +130,6 @@ class Redstone implements IPeripheral implements IExportable {
|
||||
|
||||
public function export():ExportConfig {
|
||||
return {
|
||||
type: "redstone",
|
||||
getDelegates: [
|
||||
"input" => (_) -> {return Bool(this.getInput());},
|
||||
"analog" => (_) -> {return Number(this.getAnalogInput());}
|
||||
|
||||
Reference in New Issue
Block a user