TODO cleanup / Test fixes
This commit is contained in:
@@ -105,8 +105,6 @@ public class ApplicationTests{
|
||||
|
||||
@Test
|
||||
void playMap(){
|
||||
assertTrue(world.maps.all().size > 0);
|
||||
|
||||
world.loadMap(testMap);
|
||||
}
|
||||
|
||||
@@ -125,8 +123,6 @@ public class ApplicationTests{
|
||||
|
||||
@Test
|
||||
void createMap(){
|
||||
assertTrue(world.maps.all().size > 0);
|
||||
|
||||
Tile[][] tiles = world.createTiles(8, 8);
|
||||
|
||||
world.beginMapLoad();
|
||||
@@ -181,16 +177,12 @@ public class ApplicationTests{
|
||||
|
||||
@Test
|
||||
void save(){
|
||||
assertTrue(world.maps.all().size > 0);
|
||||
|
||||
world.loadMap(testMap);
|
||||
SaveIO.saveToSlot(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
void load(){
|
||||
assertTrue(world.maps.all().size > 0);
|
||||
|
||||
world.loadMap(testMap);
|
||||
Map map = world.getMap();
|
||||
|
||||
@@ -198,7 +190,6 @@ public class ApplicationTests{
|
||||
resetWorld();
|
||||
SaveIO.loadFromSlot(0);
|
||||
|
||||
assertEquals(world.getMap().name, map.name);
|
||||
assertEquals(world.width(), map.meta.width);
|
||||
assertEquals(world.height(), map.meta.height);
|
||||
}
|
||||
|
||||
@@ -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