mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-03 13:30:25 +07:00
Added new test
This commit is contained in:
parent
7488a6d42b
commit
244eb91dfb
@ -31,7 +31,6 @@ import static io.anuke.mindustry.Vars.*;
|
||||
public class Sectors{
|
||||
private static final int sectorImageSize = 32;
|
||||
private static final boolean checkExpansion = false;
|
||||
private static final float sectorLargeChance = 0.24f;
|
||||
|
||||
private GridMap<Sector> grid = new GridMap<>();
|
||||
|
||||
|
@ -101,6 +101,11 @@ public class Pump extends LiquidBlock{
|
||||
tryDumpLiquid(tile, tile.entity.liquids.current());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean isValid(Tile tile){
|
||||
return tile != null && tile.floor().liquidDrop != null && tier >= tile.floor().liquidDrop.tier;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.backends.headless.HeadlessApplication;
|
||||
import com.badlogic.gdx.backends.headless.HeadlessApplicationConfiguration;
|
||||
import com.badlogic.gdx.math.GridPoint2;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.content.blocks.Blocks;
|
||||
@ -14,6 +15,7 @@ import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.io.BundleLoader;
|
||||
import io.anuke.mindustry.io.SaveIO;
|
||||
import io.anuke.mindustry.maps.Map;
|
||||
import io.anuke.mindustry.world.Edges;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.modules.ModuleCore;
|
||||
@ -201,4 +203,16 @@ public class ApplicationTests{
|
||||
assertTrue(world.width() == map.meta.width);
|
||||
assertTrue(world.height() == map.meta.height);
|
||||
}
|
||||
|
||||
@Test
|
||||
void edgeTest(){
|
||||
GridPoint2[] edges = Edges.getEdges(1);
|
||||
assertTrue(edges[0].equals(new GridPoint2(1, 0)));
|
||||
assertTrue(edges[1].equals(new GridPoint2(0, 1)));
|
||||
assertTrue(edges[2].equals(new GridPoint2(-1, 0)));
|
||||
assertTrue(edges[3].equals(new GridPoint2(0, -1)));
|
||||
|
||||
GridPoint2[] edges2 = Edges.getEdges(2);
|
||||
assertTrue(edges2.length == 8);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user