Correct names for buildings
This commit is contained in:
@@ -8,6 +8,7 @@ import mindustry.game.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.power.*;
|
||||
import mindustry.world.blocks.power.ItemLiquidGenerator.*;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
import java.util.*;
|
||||
@@ -26,7 +27,7 @@ public class ItemLiquidGeneratorTests extends PowerTestFixture{
|
||||
|
||||
private ItemLiquidGenerator generator;
|
||||
private Tile tile;
|
||||
private ItemLiquidGenerator.ItemLiquidGeneratorEntity entity;
|
||||
private ItemLiquidGeneratorBuild entity;
|
||||
private final float fakeItemDuration = 60f; //ticks
|
||||
private final float maximumLiquidUsage = 0.5f;
|
||||
|
||||
@@ -38,7 +39,7 @@ public class ItemLiquidGeneratorTests extends PowerTestFixture{
|
||||
powerProduction = 0.1f;
|
||||
itemDuration = fakeItemDuration;
|
||||
maxLiquidGenerate = maximumLiquidUsage;
|
||||
entityType = ItemLiquidGeneratorEntity::new;
|
||||
entityType = ItemLiquidGeneratorBuild::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,14 +43,14 @@ public class PowerTestFixture{
|
||||
|
||||
protected static PowerGenerator createFakeProducerBlock(float producedPower){
|
||||
return new PowerGenerator("fakegen"){{
|
||||
entityType = () -> new GeneratorEntity();
|
||||
entityType = () -> new GeneratorBuild();
|
||||
powerProduction = producedPower;
|
||||
}};
|
||||
}
|
||||
|
||||
protected static Battery createFakeBattery(float capacity){
|
||||
return new Battery("fakebattery"){{
|
||||
entityType = () -> new BatteryEntity();
|
||||
entityType = () -> new BatteryBuild();
|
||||
consumes.powerBuffered(capacity);
|
||||
}};
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import mindustry.*;
|
||||
import mindustry.core.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.power.*;
|
||||
import mindustry.world.blocks.power.PowerGenerator.*;
|
||||
import mindustry.world.consumers.*;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
@@ -54,7 +55,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>bc().productionEfficiency = 1f;
|
||||
producerTile.<GeneratorBuild>bc().productionEfficiency = 1f;
|
||||
Tile directConsumerTile = createFakeTile(0, 1, createFakeDirectConsumer(requiredPower));
|
||||
|
||||
PowerGraph powerGraph = new PowerGraph();
|
||||
@@ -94,7 +95,7 @@ public class PowerTests extends PowerTestFixture{
|
||||
|
||||
if(producedPower > 0.0f){
|
||||
Tile producerTile = createFakeTile(0, 0, createFakeProducerBlock(producedPower));
|
||||
producerTile.<PowerGenerator.GeneratorEntity>bc().productionEfficiency = 1f;
|
||||
producerTile.<GeneratorBuild>bc().productionEfficiency = 1f;
|
||||
powerGraph.add(producerTile.build);
|
||||
}
|
||||
Tile directConsumerTile = null;
|
||||
@@ -119,7 +120,7 @@ public class PowerTests extends PowerTestFixture{
|
||||
@Test
|
||||
void directConsumptionStopsWithNoPower(){
|
||||
Tile producerTile = createFakeTile(0, 0, createFakeProducerBlock(10.0f));
|
||||
producerTile.<PowerGenerator.GeneratorEntity>bc().productionEfficiency = 1.0f;
|
||||
producerTile.<GeneratorBuild>bc().productionEfficiency = 1.0f;
|
||||
Tile consumerTile = createFakeTile(0, 1, createFakeDirectConsumer(5.0f));
|
||||
|
||||
PowerGraph powerGraph = new PowerGraph();
|
||||
|
||||
Reference in New Issue
Block a user