mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-02-08 19:19:35 +01:00
Fikser kommentarer, mellomrom og variabelnavn i Tile og Wall Flytter IGrid, Robot og Wall til objects Flytter tester til korresponderende pakker
43 lines
1.0 KiB
Java
43 lines
1.0 KiB
Java
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 {
|
|
|
|
private TileType tileType;
|
|
private Direction direction;
|
|
|
|
/**
|
|
* 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;
|
|
}
|
|
|
|
/**
|
|
* Gets the tile type of the tile
|
|
* @return The tile's tile type
|
|
*/
|
|
public TileType getTileType() {
|
|
return tileType;
|
|
}
|
|
|
|
/**
|
|
* Gets the direction of the tile
|
|
* @return The tile's direction
|
|
*/
|
|
public Direction getDirection() {
|
|
return direction;
|
|
}
|
|
}
|