Fixed tests

This commit is contained in:
Anuken
2019-05-09 14:39:52 -04:00
parent 23843be981
commit 9f4a430412
3 changed files with 21 additions and 15 deletions

View File

@@ -72,10 +72,18 @@ public class WorldTests{
}
}
private static void fillWith(short tileID){
for(int x = 0; x < tiles.length; x++){
for(int y = 0; y < tiles[0].length; y++){
tiles[x][y] = new Tile(x, y, (short)0, (short)0, tileID);
}
}
}
@Test
void addDarknessOneNotSolidMiddleNoDarkness(){
fillWith(Blocks.rocks.id);
tiles[5][5] = new Tile(5, 5, (byte)0, Blocks.copperWall.id, (byte)0, (byte)0);
tiles[5][5] = new Tile(5, 5, (byte)0, (byte)0, Blocks.copperWall.id);
world.addDarkness(tiles);
for(int x = 0; x < tiles.length; x++){
@@ -90,7 +98,7 @@ public class WorldTests{
@Test
void addDarknessOneNotSolidCornerNoDarkness(){
fillWith(Blocks.rocks.id);
tiles[7][7] = new Tile(5, 5, (byte)0, Blocks.copperWall.id, (byte)0, (byte)0);
tiles[7][7] = new Tile(5, 5, (byte)0, (byte)0, Blocks.copperWall.id);
world.addDarkness(tiles);
for(int x = 0; x < tiles.length; x++){
@@ -101,12 +109,4 @@ public class WorldTests{
}
}
}
private static void fillWith(byte tileID){
for(int x = 0; x < tiles.length; x++){
for(int y = 0; y < tiles[0].length; y++){
tiles[x][y] = new Tile(x, y, (byte)0, tileID, (byte)0, (byte)0);
}
}
}
}