Fiasko/src/main/java/inf112/fiasko/roborally/objects/BoardElementContainer.java

39 lines
837 B
Java
Raw Normal View History

2020-03-10 16:04:27 +01:00
package inf112.fiasko.roborally.objects;
import inf112.fiasko.roborally.element_properties.Position;
/**
2020-03-16 20:06:35 +01:00
* This class represents a board element and its position
* @param <K> The type of element
*/
2020-03-16 20:06:35 +01:00
public class BoardElementContainer <K> {
private final K element;
private final Position position;
2020-03-10 16:04:27 +01:00
/**
* Initializes the BoardElementContainer
2020-03-16 20:06:35 +01:00
* @param element The element
* @param position The position
*/
2020-03-16 20:06:35 +01:00
BoardElementContainer(K element, Position position) {
this.element = element;
this.position = position;
2020-03-10 16:04:27 +01:00
}
/**
2020-03-16 20:06:35 +01:00
* Gets the element
* @return The element
*/
2020-03-16 20:06:35 +01:00
public K getElement() {
return element;
2020-03-10 16:04:27 +01:00
}
/**
* Gets the position
2020-03-16 20:06:35 +01:00
* @return The position
*/
2020-03-10 16:04:27 +01:00
public Position getPosition() {
2020-03-16 20:06:35 +01:00
return position;
2020-03-10 16:04:27 +01:00
}
}