This commit is contained in:
Leonwang4234
2020-08-08 10:24:40 -07:00
parent 3892cf2283
commit 6ff3523276
367 changed files with 12059 additions and 9678 deletions

View File

@@ -110,7 +110,6 @@ public class ApplicationTests{
Time.setDeltaProvider(() -> 1000f);
Time.update();
Time.update();
Time.setDeltaProvider(() -> 1f);
Groups.unit.update();
assertFalse(Groups.unit.isEmpty(), "No enemies spawned.");
}
@@ -289,7 +288,6 @@ public class ApplicationTests{
state.set(State.playing);
world.tile(0, 0).setBlock(Blocks.conveyor);
world.tile(0, 0).rotation(0);
world.tile(0, 0).build.acceptStack(Items.copper, 1000, null);
}
@@ -372,8 +370,7 @@ public class ApplicationTests{
Seq<Building> entities = Seq.with(world.tile(0, 0).build);
for(int i = 0; i < length; i++){
world.tile(i + 1, 0).setBlock(Blocks.conveyor);
world.tile(i + 1, 0).rotation(0);
world.tile(i + 1, 0).setBlock(Blocks.conveyor, Team.derelict, 0);
entities.add(world.tile(i + 1, 0).build);
}

View File

@@ -89,7 +89,7 @@ public class ItemLiquidGeneratorTests extends PowerTestFixture{
assertTrue(entity.acceptLiquid(null, liquid, availableLiquidAmount), inputType + " | " + parameterDescription + ": Liquids which will be declined by the generator don't need to be tested - The code won't be called for those cases.");
entity.liquids.add(liquid, availableLiquidAmount);
entity.cons().update();
entity.cons.update();
// Perform an update on the generator once - This should use up any resource up to the maximum liquid usage
entity.updateTile();
@@ -133,7 +133,7 @@ public class ItemLiquidGeneratorTests extends PowerTestFixture{
if(amount > 0){
entity.items.add(item, amount);
}
entity.cons().update();
entity.cons.update();
// Perform an update on the generator once - This should use up one or zero items - dependent on if the item is accepted and available or not.
try{
@@ -164,7 +164,7 @@ public class ItemLiquidGeneratorTests extends PowerTestFixture{
// Burn a single coal and test for the duration
entity.items.add(Items.coal, 1);
entity.cons().update();
entity.cons.update();
entity.updateTile();
float expectedEfficiency = entity.productionEfficiency;

View File

@@ -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);
tile.build = block.newEntity().init(tile, Team.sharded, false, 0);
if(block.hasPower){
tile.build.power.graph = new PowerGraph(){
//assume there's always something consuming power

View File

@@ -64,7 +64,7 @@ public class PowerTests extends PowerTestFixture{
assertEquals(producedPower * Time.delta, powerGraph.getPowerProduced(), Mathf.FLOAT_ROUNDING_ERROR);
assertEquals(requiredPower * Time.delta, powerGraph.getPowerNeeded(), Mathf.FLOAT_ROUNDING_ERROR);
// Update and check for the expected power status of the consumer
//Update and check for the expected power status of the consumer
powerGraph.update();
assertEquals(expectedSatisfaction, directConsumerTile.build.power.status, Mathf.FLOAT_ROUNDING_ERROR, parameterDescription + ": Satisfaction of direct consumer did not match");
}