From b1d7cb58aa850689c62ea260b04f142fdd9007be Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Thu, 20 Feb 2020 11:19:29 +0100 Subject: [PATCH 1/7] =?UTF-8?q?Fikser=20navn=20p=C3=A5=20tester=20i=20Posi?= =?UTF-8?q?tionTest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/java/inf112/fiasko/roborally/PositionTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/inf112/fiasko/roborally/PositionTest.java b/src/test/java/inf112/fiasko/roborally/PositionTest.java index 6fe10b3..4f30582 100644 --- a/src/test/java/inf112/fiasko/roborally/PositionTest.java +++ b/src/test/java/inf112/fiasko/roborally/PositionTest.java @@ -13,11 +13,11 @@ public class PositionTest { testPosition = new Position(3, 4); } @Test - public void TestGetXPosition(){ + public void getXPosition(){ assertEquals(3,testPosition.getXCoordinate()); } @Test - public void TestGetYPosition(){ + public void getYPosition(){ assertEquals(4,testPosition.getYCoordinate()); } } From 124fe3d6d424c9450e997c14cae02552ec689c08 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Thu, 20 Feb 2020 11:22:51 +0100 Subject: [PATCH 2/7] =?UTF-8?q?Begynner=20p=C3=A5=20en=20klasse=20som=20ko?= =?UTF-8?q?nverterer=20mellom=20elementer=20og=20teksturer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fiasko/roborally/TextureConverter.java | 204 ++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 src/main/java/inf112/fiasko/roborally/TextureConverter.java diff --git a/src/main/java/inf112/fiasko/roborally/TextureConverter.java b/src/main/java/inf112/fiasko/roborally/TextureConverter.java new file mode 100644 index 0000000..5e95cae --- /dev/null +++ b/src/main/java/inf112/fiasko/roborally/TextureConverter.java @@ -0,0 +1,204 @@ +package inf112.fiasko.roborally; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.TextureRegion; +import inf112.fiasko.roborally.objects.Tile; + +public class TextureConverter { + private Texture textureSheet = new Texture(Gdx.files.internal("assets/tiles.png")); + + private TextureConverter() {} + + /** + * Gets the texture representing the tile + * @param tile The tile to draw + * @return The texture to draw + */ + public TextureRegion convertElement(Tile tile) { + final int tileTextureHeight = 300, tileTextureWidth = 300; + switch (tile.getTileType()) { + case TILE: + return getTextureOnSheet(4, 0); + case HOLE: + return getTextureOnSheet(5, 0); + case COGWHEEL_RIGHT: + return getTextureOnSheet(5, 6); + case COGWHEEL_LEFT: + return getTextureOnSheet(4, 6); + case TRANSPORT_BAND_SLOW: + switch (tile.getDirection()) { + case NORTH: + return getTextureOnSheet(0, 6); + case EAST: + return getTextureOnSheet(3, 6); + case SOUTH: + return getTextureOnSheet(1, 6); + case WEST: + return getTextureOnSheet(2, 6); + default: + throw new IllegalArgumentException("Invalid direction for slow transport band encountered"); + } + case TRANSPORT_BAND_SLOW_RIGHT: + switch (tile.getDirection()) { + case NORTH: + return getTextureOnSheet(2, 5); + case EAST: + return getTextureOnSheet(2, 4); + case SOUTH: + return getTextureOnSheet(3, 4); + case WEST: + return getTextureOnSheet(3, 5); + default: + throw new IllegalArgumentException("Invalid direction for slow transport band encountered"); + } + case TRANSPORT_BAND_SLOW_LEFT: + switch (tile.getDirection()) { + case NORTH: + return getTextureOnSheet(1, 5); + case EAST: + return getTextureOnSheet(0, 5); + case SOUTH: + return getTextureOnSheet(0, 4); + case WEST: + return getTextureOnSheet(1, 4); + default: + throw new IllegalArgumentException("Invalid direction for slow transport band encountered"); + } + case TRANSPORT_BAND_SLOW_SIDE_ENTRANCES: + switch (tile.getDirection()) { + case NORTH: + return getTextureOnSheet(4, 8); + case EAST: + return getTextureOnSheet(0, 5); + case SOUTH: + return new TextureRegion(textureSheet, 0, 4*tileTextureHeight, + tileTextureWidth, tileTextureHeight); + case WEST: + return new TextureRegion(textureSheet, tileTextureWidth, 4*tileTextureHeight, + tileTextureWidth, tileTextureHeight); + default: + throw new IllegalArgumentException("Invalid direction for slow transport band encountered"); + } + case TRANSPORT_BAND_SLOW_SIDE_ENTRANCE_RIGHT: + switch (tile.getDirection()) { + case NORTH: + return getTextureOnSheet(0, 8); + case EAST: + return getTextureOnSheet(1, 8); + case SOUTH: + return getTextureOnSheet(2, 8); + case WEST: + return getTextureOnSheet(3, 8); + default: + throw new IllegalArgumentException("Invalid direction for slow transport band encountered"); + } + case TRANSPORT_BAND_SLOW_SIDE_ENTRANCE_LEFT: + switch (tile.getDirection()) { + case NORTH: + return getTextureOnSheet(0,7); + case EAST: + return getTextureOnSheet(1, 7); + case SOUTH: + return getTextureOnSheet(2, 7); + case WEST: + return getTextureOnSheet(3, 7); + default: + throw new IllegalArgumentException("Invalid direction for slow transport band encountered"); + } + case TRANSPORT_BAND_FAST: + switch (tile.getDirection()) { + case NORTH: + return getTextureOnSheet(4,1); + case EAST: + return getTextureOnSheet(5, 1); + case SOUTH: + return getTextureOnSheet(4, 2); + case WEST: + return getTextureOnSheet(5, 2); + default: + throw new IllegalArgumentException("Invalid direction for slow transport band encountered"); + } + case TRANSPORT_BAND_FAST_RIGHT: + switch (tile.getDirection()) { + case NORTH: + return getTextureOnSheet(2,3); + case EAST: + return getTextureOnSheet(2, 2); + case SOUTH: + return getTextureOnSheet(3, 2); + case WEST: + return getTextureOnSheet(3, 3); + default: + throw new IllegalArgumentException("Invalid direction for slow transport band encountered"); + } + case TRANSPORT_BAND_FAST_LEFT: + switch (tile.getDirection()) { + case NORTH: + return getTextureOnSheet(1,3); + case EAST: + return getTextureOnSheet(0, 3); + case SOUTH: + return getTextureOnSheet(3, 2); + case WEST: + return getTextureOnSheet(3, 3); + default: + throw new IllegalArgumentException("Invalid direction for slow transport band encountered"); + } + default: + throw new IllegalArgumentException("Invalid or unimplemented tile type encountered"); + } + } + + /** + * Gets a texture on the main tiles texture sheet + * @param x The relative x coordinate on the sheet + * @param y The relative y coordinate on the sheet + * @return The texture region containing the texture + */ + private TextureRegion getTextureOnSheet(int x, int y) { + final int tileTextureHeight = 300, tileTextureWidth = 300; + return new TextureRegion(textureSheet, x*tileTextureWidth, y*tileTextureHeight, + tileTextureWidth, tileTextureHeight); + } + + /** + * Checks whether a tile has textures for different rotations + * + * For a tile without a rotation texture, the texture needs to be rotated when rendering. + * + * @param tile The tile to check + * @return True if rotated versions of the texture exists. False otherwise + */ + public boolean hasRotatedTexture(Tile tile) { + switch (tile.getTileType()) { + case TILE: + case HOLE: + case COGWHEEL_RIGHT: + case COGWHEEL_LEFT: + case FLAG_1: + case FLAG_2: + case FLAG_3: + case FLAG_4: + case WRENCH: + case WRENCH_AND_HAMMER: + case DEATH_TILE: + return false; + case TRANSPORT_BAND_SLOW: + case TRANSPORT_BAND_SLOW_RIGHT: + case TRANSPORT_BAND_SLOW_LEFT: + case TRANSPORT_BAND_SLOW_SIDE_ENTRANCES: + case TRANSPORT_BAND_SLOW_SIDE_ENTRANCE_LEFT: + case TRANSPORT_BAND_SLOW_SIDE_ENTRANCE_RIGHT: + case TRANSPORT_BAND_FAST: + case TRANSPORT_BAND_FAST_RIGHT: + case TRANSPORT_BAND_FAST_LEFT: + case TRANSPORT_BAND_FAST_SIDE_ENTRANCES: + case TRANSPORT_BAND_FAST_SIDE_ENTRANCE_LEFT: + case TRANSPORT_BAND_FAST_SIDE_ENTRANCE_RIGHT: + return true; + default: + throw new IllegalArgumentException("Invalid tile type encountered"); + } + } +} From ac43b7e3224e3c9f2e7f3b2aec0918c008bf7532 Mon Sep 17 00:00:00 2001 From: Petter Tobias Madsen Date: Thu, 20 Feb 2020 11:56:20 +0100 Subject: [PATCH 3/7] Tobias og Gabriel lagde en robot class --- .../roborally/element_properties/Robot.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/main/java/inf112/fiasko/roborally/element_properties/Robot.java diff --git a/src/main/java/inf112/fiasko/roborally/element_properties/Robot.java b/src/main/java/inf112/fiasko/roborally/element_properties/Robot.java new file mode 100644 index 0000000..d64c434 --- /dev/null +++ b/src/main/java/inf112/fiasko/roborally/element_properties/Robot.java @@ -0,0 +1,41 @@ +package inf112.fiasko.roborally.element_properties; + +/** + * this class represtents a robot + */ +public class Robot { + private int robotDamageTaken = 0; + private int playerId; //might not be needed + private boolean inPowerDown = false; + private int lastFlagVisited = 0; + private Position backupPosition; + private Position currentPosition; + + + public Robot (int playerId, Position spawnPosition){ + this.playerId=playerId; + this.backupPosition = spawnPosition; + this.currentPosition = spawnPosition; + } + + + public int getDamage(){ + return robotDamageTaken; + } + public void setDamage (int damage){ + this.robotDamageTaken = damage; + } + public Position getPosition(){ + return currentPosition; + } + public void setPosition( Position newPosition ){ + this.currentPosition = newPosition; + } + public void setPowerDown(Boolean powerDownStatus){ + this.inPowerDown = powerDownStatus; + } + public Boolean isInPowerDown(){ + return inPowerDown; + } + +} From 9e764ecaf52bf02fb5df70d2632d32f44d1f4766 Mon Sep 17 00:00:00 2001 From: Petter Tobias Madsen Date: Thu, 20 Feb 2020 11:57:57 +0100 Subject: [PATCH 4/7] renamed TestWall to WallTest --- .../inf112/fiasko/roborally/{TestWall.java => WallTest.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/test/java/inf112/fiasko/roborally/{TestWall.java => WallTest.java} (98%) diff --git a/src/test/java/inf112/fiasko/roborally/TestWall.java b/src/test/java/inf112/fiasko/roborally/WallTest.java similarity index 98% rename from src/test/java/inf112/fiasko/roborally/TestWall.java rename to src/test/java/inf112/fiasko/roborally/WallTest.java index c94ec6a..b1f1854 100644 --- a/src/test/java/inf112/fiasko/roborally/TestWall.java +++ b/src/test/java/inf112/fiasko/roborally/WallTest.java @@ -6,7 +6,7 @@ import inf112.fiasko.roborally.element_properties.WallType; import static org.junit.Assert.assertEquals; import org.junit.Test; -public class TestWall { +public class WallTest { @Test public void testWallGetWallTypeNormal(){ Wall testGetWall = new Wall(WallType.WALL_NORMAL, Direction.NORTH); From 71562f15447ecd3715ae767ff938cb807ddc0d38 Mon Sep 17 00:00:00 2001 From: Petter Tobias Madsen Date: Thu, 20 Feb 2020 12:05:49 +0100 Subject: [PATCH 5/7] =?UTF-8?q?Tobias=20og=20Gabriel=20startet=20=C3=A5=20?= =?UTF-8?q?teste=20Robot=20classen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../roborally/element_properties/Robot.java | 2 +- .../java/inf112/fiasko/roborally/RobotTest.java | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/test/java/inf112/fiasko/roborally/RobotTest.java diff --git a/src/main/java/inf112/fiasko/roborally/element_properties/Robot.java b/src/main/java/inf112/fiasko/roborally/element_properties/Robot.java index d64c434..377c989 100644 --- a/src/main/java/inf112/fiasko/roborally/element_properties/Robot.java +++ b/src/main/java/inf112/fiasko/roborally/element_properties/Robot.java @@ -10,7 +10,7 @@ public class Robot { private int lastFlagVisited = 0; private Position backupPosition; private Position currentPosition; - + public Robot (int playerId, Position spawnPosition){ this.playerId=playerId; diff --git a/src/test/java/inf112/fiasko/roborally/RobotTest.java b/src/test/java/inf112/fiasko/roborally/RobotTest.java new file mode 100644 index 0000000..d868807 --- /dev/null +++ b/src/test/java/inf112/fiasko/roborally/RobotTest.java @@ -0,0 +1,15 @@ +package inf112.fiasko.roborally; + +import inf112.fiasko.roborally.element_properties.Position; +import inf112.fiasko.roborally.element_properties.Robot; +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class RobotTest { + @Test + public void testRobotGetDamageOnInitializedRobot(){ + Position robotPosition = new Position(3,6); + Robot testRobotGetDamage = new Robot(6, robotPosition); + assertEquals(0, testRobotGetDamage.getDamage()); + } +} From a28c92e9b95b72c1d050fb7193147834f9875527 Mon Sep 17 00:00:00 2001 From: Petter Tobias Madsen Date: Thu, 20 Feb 2020 12:21:48 +0100 Subject: [PATCH 6/7] Added a extra test to RobotTest --- src/test/java/inf112/fiasko/roborally/RobotTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/java/inf112/fiasko/roborally/RobotTest.java b/src/test/java/inf112/fiasko/roborally/RobotTest.java index d868807..cb7cb7f 100644 --- a/src/test/java/inf112/fiasko/roborally/RobotTest.java +++ b/src/test/java/inf112/fiasko/roborally/RobotTest.java @@ -12,4 +12,11 @@ public class RobotTest { Robot testRobotGetDamage = new Robot(6, robotPosition); assertEquals(0, testRobotGetDamage.getDamage()); } + @Test + public void testRobotSetDamage(){ + Position robotPosition = new Position(3,6); + Robot testRobotSetDamage = new Robot(6, robotPosition); + testRobotSetDamage.setDamage(2); + assertEquals(2, testRobotSetDamage.getDamage()); + } } From a6a004578685d54032539bb113bb4f56b03a9d5e Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Thu, 20 Feb 2020 13:12:18 +0100 Subject: [PATCH 7/7] Flytter ting til korrekte pakker og forbedrer Tile og Wall Fikser kommentarer, mellomrom og variabelnavn i Tile og Wall Flytter IGrid, Robot og Wall til objects Flytter tester til korresponderende pakker --- .../roborally/element_properties/Wall.java | 39 ------------------- .../IGrid.java | 2 +- .../Robot.java | 6 ++- .../inf112/fiasko/roborally/objects/Tile.java | 26 ++++++------- .../inf112/fiasko/roborally/objects/Wall.java | 39 +++++++++++++++++++ .../DirectionTest.java | 2 +- .../PositionTest.java | 2 +- .../TileTypeTest.java | 2 +- .../WallTypeTest.java | 2 +- .../fiasko/roborally/{ => game}/GameTest.java | 2 +- .../{ => objects}/DrawableObjectTest.java | 2 +- .../roborally/{ => objects}/RobotTest.java | 4 +- .../roborally/{ => objects}/TileTest.java | 8 +++- .../roborally/{ => objects}/WallTest.java | 4 +- 14 files changed, 73 insertions(+), 67 deletions(-) delete mode 100644 src/main/java/inf112/fiasko/roborally/element_properties/Wall.java rename src/main/java/inf112/fiasko/roborally/{element_properties => objects}/IGrid.java (94%) rename src/main/java/inf112/fiasko/roborally/{element_properties => objects}/Robot.java (87%) create mode 100644 src/main/java/inf112/fiasko/roborally/objects/Wall.java rename src/test/java/inf112/fiasko/roborally/{ => element_properties}/DirectionTest.java (97%) rename src/test/java/inf112/fiasko/roborally/{ => element_properties}/PositionTest.java (90%) rename src/test/java/inf112/fiasko/roborally/{ => element_properties}/TileTypeTest.java (96%) rename src/test/java/inf112/fiasko/roborally/{ => element_properties}/WallTypeTest.java (97%) rename src/test/java/inf112/fiasko/roborally/{ => game}/GameTest.java (95%) rename src/test/java/inf112/fiasko/roborally/{ => objects}/DrawableObjectTest.java (98%) rename src/test/java/inf112/fiasko/roborally/{ => objects}/RobotTest.java (88%) rename src/test/java/inf112/fiasko/roborally/{ => objects}/TileTest.java (80%) rename src/test/java/inf112/fiasko/roborally/{ => objects}/WallTest.java (93%) diff --git a/src/main/java/inf112/fiasko/roborally/element_properties/Wall.java b/src/main/java/inf112/fiasko/roborally/element_properties/Wall.java deleted file mode 100644 index fb8c8be..0000000 --- a/src/main/java/inf112/fiasko/roborally/element_properties/Wall.java +++ /dev/null @@ -1,39 +0,0 @@ -package inf112.fiasko.roborally.element_properties; - -public class Wall { - /** - * This class is a representation of a wall - */ - private WallType wall; - private Direction direction; - - /** - * Initializes the wall - * @param wall gives the type of wall eks. wall normal or wall corner - * @param direction gives the direction the wall is facing. - */ - public Wall (WallType wall,Direction direction){ - this.wall = wall; - this.direction = direction; - } - - /** - * Gets the type of the wall - * @return the wall type - */ - public WallType getWallType() { - return wall; - } - - /** - * Gets the direction of the wall - * @return the direction of the wall - */ - public Direction getDirection(){ - return direction; - } - - - - -} diff --git a/src/main/java/inf112/fiasko/roborally/element_properties/IGrid.java b/src/main/java/inf112/fiasko/roborally/objects/IGrid.java similarity index 94% rename from src/main/java/inf112/fiasko/roborally/element_properties/IGrid.java rename to src/main/java/inf112/fiasko/roborally/objects/IGrid.java index 29f0a4c..d509c66 100644 --- a/src/main/java/inf112/fiasko/roborally/element_properties/IGrid.java +++ b/src/main/java/inf112/fiasko/roborally/objects/IGrid.java @@ -1,4 +1,4 @@ -package inf112.fiasko.roborally.element_properties; +package inf112.fiasko.roborally.objects; /** * This Interface describes a grid diff --git a/src/main/java/inf112/fiasko/roborally/element_properties/Robot.java b/src/main/java/inf112/fiasko/roborally/objects/Robot.java similarity index 87% rename from src/main/java/inf112/fiasko/roborally/element_properties/Robot.java rename to src/main/java/inf112/fiasko/roborally/objects/Robot.java index 377c989..4e0ae97 100644 --- a/src/main/java/inf112/fiasko/roborally/element_properties/Robot.java +++ b/src/main/java/inf112/fiasko/roborally/objects/Robot.java @@ -1,7 +1,9 @@ -package inf112.fiasko.roborally.element_properties; +package inf112.fiasko.roborally.objects; + +import inf112.fiasko.roborally.element_properties.Position; /** - * this class represtents a robot + * this class represents a robot */ public class Robot { private int robotDamageTaken = 0; diff --git a/src/main/java/inf112/fiasko/roborally/objects/Tile.java b/src/main/java/inf112/fiasko/roborally/objects/Tile.java index 1022d6d..8522f59 100644 --- a/src/main/java/inf112/fiasko/roborally/objects/Tile.java +++ b/src/main/java/inf112/fiasko/roborally/objects/Tile.java @@ -3,38 +3,38 @@ package inf112.fiasko.roborally.objects; import inf112.fiasko.roborally.element_properties.Direction; import inf112.fiasko.roborally.element_properties.TileType; +/** + * This class represents a simple tile + */ public class Tile { - /** - * tileType stores the type of the specific tile. - */ private TileType tileType; - /** - * direction stores the direction of the specific tile. - */ private Direction direction; /** - * - * @param tileType sets the type of the tile. - * @param direction sets the direction the tile is facing. + * Instantiates a new tile + * @param tileType The type of the tile + * @param direction The direction of the tile */ public Tile(TileType tileType, Direction direction) { + if (direction.getDirectionID() % 2 == 0) { + throw new IllegalArgumentException("Invalid direction for tile submitted"); + } this.tileType = tileType; this.direction = direction; } /** - * - * @return the type of the specific tile. + * Gets the tile type of the tile + * @return The tile's tile type */ public TileType getTileType() { return tileType; } /** - * - * @return the direction of the specific tile. + * Gets the direction of the tile + * @return The tile's direction */ public Direction getDirection() { return direction; diff --git a/src/main/java/inf112/fiasko/roborally/objects/Wall.java b/src/main/java/inf112/fiasko/roborally/objects/Wall.java new file mode 100644 index 0000000..2057ec8 --- /dev/null +++ b/src/main/java/inf112/fiasko/roborally/objects/Wall.java @@ -0,0 +1,39 @@ +package inf112.fiasko.roborally.objects; + +import inf112.fiasko.roborally.element_properties.Direction; +import inf112.fiasko.roborally.element_properties.WallType; + +/** + * This class represents a wall + */ +public class Wall { + + private WallType wallType; + private Direction direction; + + /** + * Initializes a wall + * @param wallType The type of the wall + * @param direction The direction of the wall + */ + public Wall (WallType wallType, Direction direction) { + this.wallType = wallType; + this.direction = direction; + } + + /** + * Gets the type of the wall + * @return The wall type + */ + public WallType getWallType() { + return wallType; + } + + /** + * Gets the direction of the wall + * @return The direction of the wall + */ + public Direction getDirection(){ + return direction; + } +} diff --git a/src/test/java/inf112/fiasko/roborally/DirectionTest.java b/src/test/java/inf112/fiasko/roborally/element_properties/DirectionTest.java similarity index 97% rename from src/test/java/inf112/fiasko/roborally/DirectionTest.java rename to src/test/java/inf112/fiasko/roborally/element_properties/DirectionTest.java index 987f1fb..9a95c51 100644 --- a/src/test/java/inf112/fiasko/roborally/DirectionTest.java +++ b/src/test/java/inf112/fiasko/roborally/element_properties/DirectionTest.java @@ -1,4 +1,4 @@ -package inf112.fiasko.roborally; +package inf112.fiasko.roborally.element_properties; import inf112.fiasko.roborally.element_properties.Direction; import org.junit.Test; diff --git a/src/test/java/inf112/fiasko/roborally/PositionTest.java b/src/test/java/inf112/fiasko/roborally/element_properties/PositionTest.java similarity index 90% rename from src/test/java/inf112/fiasko/roborally/PositionTest.java rename to src/test/java/inf112/fiasko/roborally/element_properties/PositionTest.java index 825e0c5..b0b05ae 100644 --- a/src/test/java/inf112/fiasko/roborally/PositionTest.java +++ b/src/test/java/inf112/fiasko/roborally/element_properties/PositionTest.java @@ -1,4 +1,4 @@ -package inf112.fiasko.roborally; +package inf112.fiasko.roborally.element_properties; import inf112.fiasko.roborally.element_properties.Position; import org.junit.Before; diff --git a/src/test/java/inf112/fiasko/roborally/TileTypeTest.java b/src/test/java/inf112/fiasko/roborally/element_properties/TileTypeTest.java similarity index 96% rename from src/test/java/inf112/fiasko/roborally/TileTypeTest.java rename to src/test/java/inf112/fiasko/roborally/element_properties/TileTypeTest.java index 266c6b3..368e941 100644 --- a/src/test/java/inf112/fiasko/roborally/TileTypeTest.java +++ b/src/test/java/inf112/fiasko/roborally/element_properties/TileTypeTest.java @@ -1,4 +1,4 @@ -package inf112.fiasko.roborally; +package inf112.fiasko.roborally.element_properties; import inf112.fiasko.roborally.element_properties.TileType; import org.junit.Test; diff --git a/src/test/java/inf112/fiasko/roborally/WallTypeTest.java b/src/test/java/inf112/fiasko/roborally/element_properties/WallTypeTest.java similarity index 97% rename from src/test/java/inf112/fiasko/roborally/WallTypeTest.java rename to src/test/java/inf112/fiasko/roborally/element_properties/WallTypeTest.java index 8ae480d..9236c87 100644 --- a/src/test/java/inf112/fiasko/roborally/WallTypeTest.java +++ b/src/test/java/inf112/fiasko/roborally/element_properties/WallTypeTest.java @@ -1,4 +1,4 @@ -package inf112.fiasko.roborally; +package inf112.fiasko.roborally.element_properties; import inf112.fiasko.roborally.element_properties.TileType; import inf112.fiasko.roborally.element_properties.WallType; diff --git a/src/test/java/inf112/fiasko/roborally/GameTest.java b/src/test/java/inf112/fiasko/roborally/game/GameTest.java similarity index 95% rename from src/test/java/inf112/fiasko/roborally/GameTest.java rename to src/test/java/inf112/fiasko/roborally/game/GameTest.java index 9441102..2e2ae88 100644 --- a/src/test/java/inf112/fiasko/roborally/GameTest.java +++ b/src/test/java/inf112/fiasko/roborally/game/GameTest.java @@ -1,4 +1,4 @@ -package inf112.fiasko.roborally; +package inf112.fiasko.roborally.game; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; diff --git a/src/test/java/inf112/fiasko/roborally/DrawableObjectTest.java b/src/test/java/inf112/fiasko/roborally/objects/DrawableObjectTest.java similarity index 98% rename from src/test/java/inf112/fiasko/roborally/DrawableObjectTest.java rename to src/test/java/inf112/fiasko/roborally/objects/DrawableObjectTest.java index 7c767d3..bc106af 100644 --- a/src/test/java/inf112/fiasko/roborally/DrawableObjectTest.java +++ b/src/test/java/inf112/fiasko/roborally/objects/DrawableObjectTest.java @@ -1,4 +1,4 @@ -package inf112.fiasko.roborally; +package inf112.fiasko.roborally.objects; import inf112.fiasko.roborally.objects.DrawableObject; import inf112.fiasko.roborally.element_properties.GameTexture; diff --git a/src/test/java/inf112/fiasko/roborally/RobotTest.java b/src/test/java/inf112/fiasko/roborally/objects/RobotTest.java similarity index 88% rename from src/test/java/inf112/fiasko/roborally/RobotTest.java rename to src/test/java/inf112/fiasko/roborally/objects/RobotTest.java index cb7cb7f..4182741 100644 --- a/src/test/java/inf112/fiasko/roborally/RobotTest.java +++ b/src/test/java/inf112/fiasko/roborally/objects/RobotTest.java @@ -1,7 +1,7 @@ -package inf112.fiasko.roborally; +package inf112.fiasko.roborally.objects; import inf112.fiasko.roborally.element_properties.Position; -import inf112.fiasko.roborally.element_properties.Robot; +import inf112.fiasko.roborally.objects.Robot; import static org.junit.Assert.assertEquals; import org.junit.Test; diff --git a/src/test/java/inf112/fiasko/roborally/TileTest.java b/src/test/java/inf112/fiasko/roborally/objects/TileTest.java similarity index 80% rename from src/test/java/inf112/fiasko/roborally/TileTest.java rename to src/test/java/inf112/fiasko/roborally/objects/TileTest.java index 287645f..a6dd76c 100644 --- a/src/test/java/inf112/fiasko/roborally/TileTest.java +++ b/src/test/java/inf112/fiasko/roborally/objects/TileTest.java @@ -1,8 +1,7 @@ -package inf112.fiasko.roborally; +package inf112.fiasko.roborally.objects; import inf112.fiasko.roborally.element_properties.Direction; import inf112.fiasko.roborally.element_properties.TileType; -import inf112.fiasko.roborally.objects.Tile; import org.junit.Before; import org.junit.Test; @@ -38,4 +37,9 @@ public class TileTest { public void getDirectionFromTile2() { assertEquals(Direction.SOUTH, tile2.getDirection()); } + + @Test (expected = IllegalArgumentException.class) + public void invalidTileThrowsException() { + new Tile(TileType.TRANSPORT_BAND_FAST, Direction.NORTH_EAST); + } } \ No newline at end of file diff --git a/src/test/java/inf112/fiasko/roborally/WallTest.java b/src/test/java/inf112/fiasko/roborally/objects/WallTest.java similarity index 93% rename from src/test/java/inf112/fiasko/roborally/WallTest.java rename to src/test/java/inf112/fiasko/roborally/objects/WallTest.java index b1f1854..5455c2c 100644 --- a/src/test/java/inf112/fiasko/roborally/WallTest.java +++ b/src/test/java/inf112/fiasko/roborally/objects/WallTest.java @@ -1,7 +1,7 @@ -package inf112.fiasko.roborally; +package inf112.fiasko.roborally.objects; import inf112.fiasko.roborally.element_properties.Direction; -import inf112.fiasko.roborally.element_properties.Wall; +import inf112.fiasko.roborally.objects.Wall; import inf112.fiasko.roborally.element_properties.WallType; import static org.junit.Assert.assertEquals; import org.junit.Test;