Many changes to improve scripting
This commit is contained in:
@@ -51,7 +51,7 @@ public class PowerTests extends PowerTestFixture{
|
||||
|
||||
void simulateDirectConsumption(float producedPower, float requiredPower, float expectedSatisfaction, String parameterDescription){
|
||||
Tile producerTile = createFakeTile(0, 0, createFakeProducerBlock(producedPower));
|
||||
producerTile.<PowerGenerator.GeneratorEntity>entity().productionEfficiency = 1f;
|
||||
producerTile.<PowerGenerator.GeneratorEntity>ent().productionEfficiency = 1f;
|
||||
Tile directConsumerTile = createFakeTile(0, 1, createFakeDirectConsumer(requiredPower));
|
||||
|
||||
PowerGraph powerGraph = new PowerGraph();
|
||||
@@ -91,7 +91,7 @@ public class PowerTests extends PowerTestFixture{
|
||||
|
||||
if(producedPower > 0.0f){
|
||||
Tile producerTile = createFakeTile(0, 0, createFakeProducerBlock(producedPower));
|
||||
producerTile.<PowerGenerator.GeneratorEntity>entity().productionEfficiency = 1f;
|
||||
producerTile.<PowerGenerator.GeneratorEntity>ent().productionEfficiency = 1f;
|
||||
powerGraph.add(producerTile);
|
||||
}
|
||||
Tile directConsumerTile = null;
|
||||
@@ -116,7 +116,7 @@ public class PowerTests extends PowerTestFixture{
|
||||
@Test
|
||||
void directConsumptionStopsWithNoPower(){
|
||||
Tile producerTile = createFakeTile(0, 0, createFakeProducerBlock(10.0f));
|
||||
producerTile.<PowerGenerator.GeneratorEntity>entity().productionEfficiency = 1.0f;
|
||||
producerTile.<PowerGenerator.GeneratorEntity>ent().productionEfficiency = 1.0f;
|
||||
Tile consumerTile = createFakeTile(0, 1, createFakeDirectConsumer(5.0f));
|
||||
|
||||
PowerGraph powerGraph = new PowerGraph();
|
||||
@@ -133,7 +133,7 @@ public class PowerTests extends PowerTestFixture{
|
||||
assertEquals(0.0f, consumerTile.entity.power.status, Mathf.FLOAT_ROUNDING_ERROR);
|
||||
if(consumerTile.block().consumes.hasPower()){
|
||||
ConsumePower consumePower = consumerTile.block().consumes.getPower();
|
||||
assertFalse(consumePower.valid(consumerTile.entity()));
|
||||
assertFalse(consumePower.valid(consumerTile.ent()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user