added BigReactor Perph
This commit is contained in:
parent
f68ae00098
commit
63e279f879
182
src/kernel/peripherals/BigReactor.hx
Normal file
182
src/kernel/peripherals/BigReactor.hx
Normal file
@ -0,0 +1,182 @@
|
||||
package kernel.peripherals;
|
||||
|
||||
import cc.Peripheral;
|
||||
|
||||
using tink.CoreApi;
|
||||
|
||||
class BigReactor implements IPeripheral {
|
||||
public static inline final TYPE_NAME:String = "BigReactors-Reactor";
|
||||
|
||||
private final addr:String;
|
||||
|
||||
public function new(addr:String) {
|
||||
this.addr = addr;
|
||||
}
|
||||
|
||||
public function getAddr():String {
|
||||
return addr;
|
||||
}
|
||||
|
||||
public function getType():String {
|
||||
return TYPE_NAME;
|
||||
}
|
||||
|
||||
public inline function getActive():Bool {
|
||||
return Peripheral.call(addr, "getActive");
|
||||
}
|
||||
|
||||
public inline function getNumberOfControlRods():Int {
|
||||
return Peripheral.call(addr, "getNumberOfControlRods");
|
||||
}
|
||||
|
||||
public inline function getEnergyStored():Float {
|
||||
return Peripheral.call(addr, "getEnergyStored");
|
||||
}
|
||||
|
||||
public inline function getFuelTemperature():Float {
|
||||
return Peripheral.call(addr, "getFuelTemperature");
|
||||
}
|
||||
|
||||
public inline function getCasingTemperature():Float {
|
||||
return Peripheral.call(addr, "getCasingTemperature");
|
||||
}
|
||||
|
||||
public inline function getFuelAmount():Int {
|
||||
return Peripheral.call(addr, "getFuelAmount");
|
||||
}
|
||||
|
||||
public inline function getWasteAmount():Int {
|
||||
return Peripheral.call(addr, "getWasteAmount");
|
||||
}
|
||||
|
||||
public inline function getFuelAmountMax():Int {
|
||||
return Peripheral.call(addr, "getFuelAmountMax");
|
||||
}
|
||||
|
||||
public function getControlRodName(controlRodIndex:Int):String {
|
||||
// TODO: check in bounds
|
||||
return Peripheral.call(addr, "getControlRodName", controlRodIndex);
|
||||
}
|
||||
|
||||
public function getControlRodLevel(controlRodIndex:Int):Int {
|
||||
// TODO: check in bounds
|
||||
return Peripheral.call(addr, "getControlRodLevel", controlRodIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
If the reactor is actively cooled, returns the amount of hot fluid produced in the past tick, in milli-Buckets (mB).
|
||||
**/
|
||||
public inline function getEnergyProducedLastTick():Float {
|
||||
return Peripheral.call(addr, "getEnergyProducedLastTick");
|
||||
}
|
||||
|
||||
/**
|
||||
If the reactor is passively cooled, always returns 0.
|
||||
**/
|
||||
public inline function getHotFluidProducedLastTick():Float {
|
||||
return Peripheral.call(addr, "getHotFluidProducedLastTick");
|
||||
}
|
||||
|
||||
public inline function getCoolantType():Null<String> {
|
||||
return Peripheral.call(addr, "getCoolantType");
|
||||
}
|
||||
|
||||
/**
|
||||
in milli-buckets (mB)
|
||||
**/
|
||||
public inline function getCoolantAmount():Int {
|
||||
return Peripheral.call(addr, "getCoolantAmount");
|
||||
}
|
||||
|
||||
/**
|
||||
in milli-buckets (mB)
|
||||
**/
|
||||
public inline function getCoolantAmountMax():Int {
|
||||
return Peripheral.call(addr, "getCoolantAmountMax");
|
||||
}
|
||||
|
||||
public inline function getHotFluidType():Null<String> {
|
||||
return Peripheral.call(addr, "getHotFluidType");
|
||||
}
|
||||
|
||||
/**
|
||||
in milli-buckets (mB)
|
||||
**/
|
||||
public inline function getHotFluidAmount():Int {
|
||||
return Peripheral.call(addr, "getHotFluidAmount");
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the reactivity level of the reactor's fuel. 100 = 100 percent
|
||||
**/
|
||||
public inline function getFuelReactivity():Int {
|
||||
return Peripheral.call(addr, "getFuelReactivity");
|
||||
}
|
||||
|
||||
public inline function getFuelConsumedLastTick():Float {
|
||||
return Peripheral.call(addr, "getFuelConsumedLastTick");
|
||||
}
|
||||
|
||||
public inline function isActivelyCooled():Bool {
|
||||
return Peripheral.call(addr, "isActivelyCooled");
|
||||
}
|
||||
|
||||
public inline function setActive(active:Bool):Void {
|
||||
Peripheral.call(addr, "setActive", active);
|
||||
}
|
||||
|
||||
/**
|
||||
0 (not inserted) to 100 (fully inserted)
|
||||
**/
|
||||
public inline function setAllControlRodLevels(level:Int) {
|
||||
Peripheral.call(addr, "setAllControlRodLevels", level);
|
||||
}
|
||||
|
||||
/**
|
||||
0 (not inserted) to 100 (fully inserted)
|
||||
**/
|
||||
public function setControlRodLevel(index:Int, level:Int):Void {
|
||||
// TODO: check in bounds
|
||||
Peripheral.call(addr, "setControlRodLevel", index, level);
|
||||
}
|
||||
|
||||
public inline function doEjectWaste():Void {
|
||||
throw new Error("Not implemented");
|
||||
}
|
||||
|
||||
public inline function doEjectFuel():Void {
|
||||
throw new Error("Not implemented");
|
||||
}
|
||||
|
||||
public inline function getControlRodLocation(index:Int):Void {
|
||||
throw new Error("Not implemented");
|
||||
}
|
||||
|
||||
public inline function getEnergyStoredAsText():String {
|
||||
return Peripheral.call(addr, "getEnergyStoredAsText");
|
||||
}
|
||||
|
||||
public inline function getVariant():String {
|
||||
return Peripheral.call(addr, "getVariant");
|
||||
}
|
||||
|
||||
public inline function setControlRodName(index:Int, name:String):Void {
|
||||
Peripheral.call(addr, "setControlRodName", index, name);
|
||||
}
|
||||
|
||||
// Useless methods
|
||||
// getFuelStats
|
||||
// getEnergyStats
|
||||
// getCoolantFluidStats
|
||||
// getHotFluidStats
|
||||
|
||||
// TODO: need research
|
||||
// isMethodAvailable(method: String): Bool
|
||||
// mbGetMaximumCoordinate(): Pos3
|
||||
// mbGetMinimumCoordinate(): Pos3
|
||||
// mbGetMultiblockControllerTypeName(): String
|
||||
// mbIsAssembled(): Bool
|
||||
// mbIsConnected(): Bool
|
||||
// mbIsDisassembled(): Bool
|
||||
// mbIsPaused(): Bool
|
||||
}
|
Loading…
Reference in New Issue
Block a user