Bugfixes / Power capacity sensor
|
Before Width: | Height: | Size: 841 B After Width: | Height: | Size: 874 B |
|
Before Width: | Height: | Size: 776 B After Width: | Height: | Size: 783 B |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 184 KiB After Width: | Height: | Size: 183 KiB |
|
Before Width: | Height: | Size: 385 KiB After Width: | Height: | Size: 385 KiB |
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 1.8 MiB After Width: | Height: | Size: 1.8 MiB |
|
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 185 KiB |
|
Before Width: | Height: | Size: 391 KiB After Width: | Height: | Size: 391 KiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
@@ -1177,6 +1177,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
if(sensor == LSensor.powerNetIn && power != null) return power.graph.getPowerProduced();
|
if(sensor == LSensor.powerNetIn && power != null) return power.graph.getPowerProduced();
|
||||||
if(sensor == LSensor.powerNetOut && power != null) return power.graph.getPowerNeeded();
|
if(sensor == LSensor.powerNetOut && power != null) return power.graph.getPowerNeeded();
|
||||||
if(sensor == LSensor.powerNetStored && power != null) return power.graph.getLastPowerStored();
|
if(sensor == LSensor.powerNetStored && power != null) return power.graph.getLastPowerStored();
|
||||||
|
if(sensor == LSensor.powerNetCapacity && power != null) return power.graph.getBatteryCapacity();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class LAssembler{
|
|||||||
String[] lines = data.split("[;\n]+");
|
String[] lines = data.split("[;\n]+");
|
||||||
for(String line : lines){
|
for(String line : lines){
|
||||||
//comments
|
//comments
|
||||||
//if(line.startsWith("#")) continue;
|
if(line.startsWith("#")) continue;
|
||||||
|
|
||||||
String[] tokens = line.split(" ");
|
String[] tokens = line.split(" ");
|
||||||
LStatement st = LogicIO.read(tokens);
|
LStatement st = LogicIO.read(tokens);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ public enum LSensor{
|
|||||||
totalLiquids,
|
totalLiquids,
|
||||||
totalPower,
|
totalPower,
|
||||||
powerNetStored,
|
powerNetStored,
|
||||||
|
powerNetCapacity,
|
||||||
powerNetIn,
|
powerNetIn,
|
||||||
powerNetOut,
|
powerNetOut,
|
||||||
health,
|
health,
|
||||||
|
|||||||
@@ -24,11 +24,12 @@ public abstract class LStatement{
|
|||||||
public abstract LCategory category();
|
public abstract LCategory category();
|
||||||
public abstract LInstruction build(LAssembler builder);
|
public abstract LInstruction build(LAssembler builder);
|
||||||
|
|
||||||
//TODO doesn't work with modded stuff
|
|
||||||
public LStatement copy(){
|
public LStatement copy(){
|
||||||
StringBuilder build = new StringBuilder();
|
StringBuilder build = new StringBuilder();
|
||||||
write(build);
|
write(build);
|
||||||
return LogicIO.read(build.toString().split(" "));
|
String[] split = build.toString().split(" ");
|
||||||
|
LStatement result = LogicIO.read(split);
|
||||||
|
return result == null && LAssembler.customParsers.containsKey(split[0]) ? LAssembler.customParsers.get(split[0]).get(split) : result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//protected methods are only for internal UI layout utilities
|
//protected methods are only for internal UI layout utilities
|
||||||
|
|||||||