Correct names for buildings

This commit is contained in:
Anuken
2020-08-11 11:12:18 -04:00
parent bb3c80c055
commit 2b96d30255
98 changed files with 219 additions and 430 deletions

View File

@@ -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

View File

@@ -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);
}};
}

View File

@@ -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();