added energyStorage perf

This commit is contained in:
Djeeberjr 2023-06-07 15:15:50 +02:00
parent 13fe7fbab1
commit f85ff77728
2 changed files with 25 additions and 1 deletions

View File

@ -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;
}
}

View File

@ -1,6 +1,5 @@
package kernel.peripherals; package kernel.peripherals;
import haxe.ds.ReadOnlyArray;
import kernel.peripherals.Modem; import kernel.peripherals.Modem;
import kernel.peripherals.Screen; import kernel.peripherals.Screen;