This commit is contained in:
Anuken 2020-09-12 12:47:18 -04:00
parent 197b67f8c1
commit fa9611e28c
14 changed files with 64 additions and 45 deletions

View file

@ -377,7 +377,7 @@ public class ApplicationTests{
world.tile(length + 1, 0).setBlock(new Block("___"){{
hasItems = true;
destructible = true;
entityType = () -> new Building(){
buildType = () -> new Building(){
@Override
public void handleItem(Building source, Item item){
itemsa[0] ++;

View file

@ -39,7 +39,7 @@ public class ItemLiquidGeneratorTests extends PowerTestFixture{
powerProduction = 0.1f;
itemDuration = fakeItemDuration;
maxLiquidGenerate = maximumLiquidUsage;
entityType = ItemLiquidGeneratorBuild::new;
buildType = ItemLiquidGeneratorBuild::new;
}
@Override

View file

@ -43,21 +43,21 @@ public class PowerTestFixture{
protected static PowerGenerator createFakeProducerBlock(float producedPower){
return new PowerGenerator("fakegen"){{
entityType = () -> new GeneratorBuild();
buildType = () -> new GeneratorBuild();
powerProduction = producedPower;
}};
}
protected static Battery createFakeBattery(float capacity){
return new Battery("fakebattery"){{
entityType = () -> new BatteryBuild();
buildType = () -> new BatteryBuild();
consumes.powerBuffered(capacity);
}};
}
protected static Block createFakeDirectConsumer(float powerPerTick){
return new PowerBlock("fakedirectconsumer"){{
entityType = Building::create;
buildType = Building::create;
consumes.power(powerPerTick);
}};
}
@ -86,7 +86,7 @@ public class PowerTestFixture{
Reflect.set(Tile.class, tile, "floor", Blocks.sand);
// Simulate the "changed" method. Calling it through reflections would require half the game to be initialized.
tile.build = block.newEntity().init(tile, Team.sharded, false, 0);
tile.build = block.newBuilding().init(tile, Team.sharded, false, 0);
if(block.hasPower){
tile.build.power.graph = new PowerGraph(){
//assume there's always something consuming power