added energyStorage perf
This commit is contained in:
parent
13fe7fbab1
commit
f85ff77728
25
src/kernel/peripherals/EnergyStorage.hx
Normal file
25
src/kernel/peripherals/EnergyStorage.hx
Normal 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;
|
||||
}
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package kernel.peripherals;
|
||||
|
||||
import haxe.ds.ReadOnlyArray;
|
||||
import kernel.peripherals.Modem;
|
||||
import kernel.peripherals.Screen;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user