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-12 11:15:03 +01:00
|
|
|
/**
|
2020-03-16 20:06:35 +01:00
|
|
|
* This class represents a board element and its position
|
2020-04-20 13:13:04 +02:00
|
|
|
*
|
2020-03-16 20:06:35 +01:00
|
|
|
* @param <K> The type of element
|
2020-03-12 11:15:03 +01:00
|
|
|
*/
|
2020-04-20 13:13:04 +02:00
|
|
|
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
|
|
|
|
2020-03-12 11:15:03 +01:00
|
|
|
/**
|
|
|
|
* Initializes the BoardElementContainer
|
2020-04-20 13:13:04 +02:00
|
|
|
*
|
|
|
|
* @param element The element
|
2020-03-16 20:06:35 +01:00
|
|
|
* @param position The position
|
2020-03-12 11:15:03 +01:00
|
|
|
*/
|
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-12 11:15:03 +01:00
|
|
|
/**
|
2020-03-16 20:06:35 +01:00
|
|
|
* Gets the element
|
2020-04-20 13:13:04 +02:00
|
|
|
*
|
2020-03-16 20:06:35 +01:00
|
|
|
* @return The element
|
2020-03-12 11:15:03 +01:00
|
|
|
*/
|
2020-03-16 20:06:35 +01:00
|
|
|
public K getElement() {
|
|
|
|
return element;
|
2020-03-10 16:04:27 +01:00
|
|
|
}
|
|
|
|
|
2020-03-12 11:15:03 +01:00
|
|
|
/**
|
|
|
|
* Gets the position
|
2020-04-20 13:13:04 +02:00
|
|
|
*
|
2020-03-16 20:06:35 +01:00
|
|
|
* @return The position
|
2020-03-12 11:15:03 +01:00
|
|
|
*/
|
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
|
|
|
}
|
|
|
|
}
|