TODO cleanup / Test fixes
This commit is contained in:
@@ -41,7 +41,7 @@ public class DirectConsumerTests extends PowerTestFixture{
|
||||
consumerTile.entity.items.add(Items.lead, leadAmount);
|
||||
|
||||
Tile producerTile = createFakeTile(2, 0, createFakeProducerBlock(producedPower));
|
||||
producerTile.<PowerGenerator.GeneratorEntity>entity().productionEfficiency = 0.5f; // 100%
|
||||
producerTile.<PowerGenerator.GeneratorEntity>entity().productionEfficiency = 1f;
|
||||
|
||||
PowerGraph graph = new PowerGraph();
|
||||
graph.add(producerTile);
|
||||
|
||||
@@ -38,9 +38,8 @@ public class PowerTestFixture{
|
||||
}
|
||||
|
||||
protected static PowerGenerator createFakeProducerBlock(float producedPower){
|
||||
// Multiply produced power by 2 since production efficiency is defined to be 0.5 = 100%
|
||||
return new PowerGenerator("fakegen"){{
|
||||
powerProduction = producedPower * 2.0f;
|
||||
powerProduction = producedPower;
|
||||
}};
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ 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 = 0.5f; // Currently, 0.5f = 100%
|
||||
Tile directConsumerTile = createFakeTile(0, 1, createFakeDirectConsumer(requiredPower));
|
||||
|
||||
PowerGraph powerGraph = new PowerGraph();
|
||||
@@ -91,7 +90,6 @@ public class PowerTests extends PowerTestFixture{
|
||||
}
|
||||
void simulateBufferedConsumption(float producedPower, float maxBuffer, float powerConsumedPerTick, float initialSatisfaction, float expectedSatisfaction, String parameterDescription){
|
||||
Tile producerTile = createFakeTile(0, 0, createFakeProducerBlock(producedPower));
|
||||
producerTile.<PowerGenerator.GeneratorEntity>entity().productionEfficiency = 0.5f; // Currently, 0.5 = 100%
|
||||
Tile bufferedConsumerTile = createFakeTile(0, 1, createFakeBufferedConsumer(maxBuffer, maxBuffer > 0.0f ? maxBuffer/powerConsumedPerTick : 1.0f));
|
||||
bufferedConsumerTile.entity.power.satisfaction = initialSatisfaction;
|
||||
|
||||
@@ -136,7 +134,6 @@ public class PowerTests extends PowerTestFixture{
|
||||
|
||||
if(producedPower > 0.0f){
|
||||
Tile producerTile = createFakeTile(0, 0, createFakeProducerBlock(producedPower));
|
||||
producerTile.<PowerGenerator.GeneratorEntity>entity().productionEfficiency = 0.5f;
|
||||
powerGraph.add(producerTile);
|
||||
}
|
||||
Tile directConsumerTile = null;
|
||||
|
||||
Reference in New Issue
Block a user