diff --git a/src/kernel/peripherals/EnergyStorage.hx b/src/kernel/peripherals/EnergyStorage.hx new file mode 100644 index 0000000..cf3da2d --- /dev/null +++ b/src/kernel/peripherals/EnergyStorage.hx @@ -0,0 +1,25 @@ +package kernel.peripherals; + +class EnergyStorage implements IPeripheral{ + public static inline final TYPE_NAME:String = "energyCell"; + + private final addr:String; + private final native: cc.periphs.EnergyStorage; + + public function new(addr: String) { + this.addr = addr; + this.native = cc.Peripheral.wrap(addr); + } + + public function getEnergy(): Int { + return this.native.getEnergy(); + } + + public function getEnergyCapacity(): Int { + return this.native.getEnergyCapacity(); + } + + public function getAddr():String { + return this.addr; + } +} diff --git a/src/kernel/peripherals/Peripherals.hx b/src/kernel/peripherals/Peripherals.hx index 9d40485..9c45ede 100644 --- a/src/kernel/peripherals/Peripherals.hx +++ b/src/kernel/peripherals/Peripherals.hx @@ -1,6 +1,5 @@ package kernel.peripherals; -import haxe.ds.ReadOnlyArray; import kernel.peripherals.Modem; import kernel.peripherals.Screen;