More cleanup

This commit is contained in:
Anuken 2020-02-03 20:24:49 -05:00
parent 88d2ec5be8
commit a942ed2cad
141 changed files with 2213 additions and 1819 deletions

View file

@ -66,7 +66,7 @@ public class PowerTests extends PowerTestFixture{
// Update and check for the expected power status of the consumer
powerGraph.update();
assertEquals(expectedSatisfaction, directConsumerTile.entity.power.status, Mathf.FLOAT_ROUNDING_ERROR, parameterDescription + ": Satisfaction of direct consumer did not match");
assertEquals(expectedSatisfaction, directConsumertile.entity.getPower().status, Mathf.FLOAT_ROUNDING_ERROR, parameterDescription + ": Satisfaction of direct consumer did not match");
}
/**
@ -104,14 +104,14 @@ public class PowerTests extends PowerTestFixture{
}
float maxCapacity = 100f;
Tile batteryTile = createFakeTile(0, 2, createFakeBattery(maxCapacity));
batteryTile.entity.power.status = initialBatteryCapacity / maxCapacity;
batterytile.entity.getPower().status = initialBatteryCapacity / maxCapacity;
powerGraph.add(batteryTile);
powerGraph.update();
assertEquals(expectedBatteryCapacity / maxCapacity, batteryTile.entity.power.status, Mathf.FLOAT_ROUNDING_ERROR, parameterDescription + ": Expected battery status did not match");
assertEquals(expectedBatteryCapacity / maxCapacity, batterytile.entity.getPower().status, Mathf.FLOAT_ROUNDING_ERROR, parameterDescription + ": Expected battery status did not match");
if(directConsumerTile != null){
assertEquals(expectedSatisfaction, directConsumerTile.entity.power.status, Mathf.FLOAT_ROUNDING_ERROR, parameterDescription + ": Satisfaction of direct consumer did not match");
assertEquals(expectedSatisfaction, directConsumertile.entity.getPower().status, Mathf.FLOAT_ROUNDING_ERROR, parameterDescription + ": Satisfaction of direct consumer did not match");
}
}
@ -127,13 +127,13 @@ public class PowerTests extends PowerTestFixture{
powerGraph.add(consumerTile);
powerGraph.update();
assertEquals(1.0f, consumerTile.entity.power.status, Mathf.FLOAT_ROUNDING_ERROR);
assertEquals(1.0f, consumertile.entity.getPower().status, Mathf.FLOAT_ROUNDING_ERROR);
powerGraph.remove(producerTile);
powerGraph.add(consumerTile);
powerGraph.update();
assertEquals(0.0f, consumerTile.entity.power.status, Mathf.FLOAT_ROUNDING_ERROR);
assertEquals(0.0f, consumertile.entity.getPower().status, Mathf.FLOAT_ROUNDING_ERROR);
if(consumerTile.block().consumes.hasPower()){
ConsumePower consumePower = consumerTile.block().consumes.getPower();
assertFalse(consumePower.valid(consumerTile.ent()));