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

43 lines
860 B
Java
Raw Normal View History

2020-03-10 16:04:27 +01:00
package inf112.fiasko.roborally.objects;
2020-04-14 15:54:09 +02:00
import inf112.fiasko.roborally.elementproperties.Position;
2020-03-10 16:04:27 +01:00
/**
2020-03-16 20:06:35 +01:00
* This class represents a board element and its position
*
2020-03-16 20:06:35 +01:00
* @param <K> The type of element
*/
public class BoardElementContainer<K> {
2020-03-16 20:06:35 +01:00
private final K element;
private final Position position;
2020-03-10 16:04:27 +01:00
/**
* Initializes the BoardElementContainer
*
* @param element The element
2020-03-16 20:06:35 +01:00
* @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
*
2020-03-16 20:06:35 +01:00
* @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
}
}