43 lines
1.0 KiB
Java
Raw Normal View History

2020-02-20 10:41:47 +01:00
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
*/
2020-02-20 10:41:47 +01:00
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
2020-02-20 10:41:47 +01:00
*/
public Tile(TileType tileType, Direction direction) {
if (direction.getDirectionID() % 2 == 0) {
throw new IllegalArgumentException("Invalid direction for tile submitted");
}
2020-02-20 10:41:47 +01:00
this.tileType = tileType;
this.direction = direction;
}
/**
* Gets the tile type of the tile
* @return The tile's tile type
2020-02-20 10:41:47 +01:00
*/
public TileType getTileType() {
return tileType;
}
/**
* Gets the direction of the tile
* @return The tile's direction
2020-02-20 10:41:47 +01:00
*/
public Direction getDirection() {
return direction;
}
}