2020-03-10 16:04:27 +01:00
|
|
|
package inf112.fiasko.roborally.objects;
|
|
|
|
|
|
|
|
import inf112.fiasko.roborally.element_properties.Position;
|
|
|
|
|
2020-03-12 11:15:03 +01:00
|
|
|
/**
|
|
|
|
* This class represents a type of object and its position
|
|
|
|
* @param <K> The type of object
|
|
|
|
*/
|
2020-03-10 16:04:27 +01:00
|
|
|
public class BoardElementContainer <K>{
|
|
|
|
K obj;
|
2020-03-16 15:52:18 +01:00
|
|
|
private Position pos;
|
2020-03-10 16:04:27 +01:00
|
|
|
|
2020-03-12 11:15:03 +01:00
|
|
|
/**
|
|
|
|
* Initializes the BoardElementContainer
|
|
|
|
* @param obj The object
|
|
|
|
* @param pos The position
|
|
|
|
*/
|
2020-03-10 16:04:27 +01:00
|
|
|
BoardElementContainer(K obj, Position pos) {
|
|
|
|
this.obj = obj;
|
|
|
|
this.pos = pos;
|
|
|
|
}
|
|
|
|
|
2020-03-12 11:15:03 +01:00
|
|
|
/**
|
|
|
|
* Gets the object
|
|
|
|
* @return object
|
|
|
|
*/
|
2020-03-10 16:04:27 +01:00
|
|
|
public K getObject() {
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
2020-03-12 11:15:03 +01:00
|
|
|
/**
|
|
|
|
* Gets the position
|
|
|
|
* @return position
|
|
|
|
*/
|
2020-03-10 16:04:27 +01:00
|
|
|
public Position getPosition() {
|
|
|
|
return pos;
|
|
|
|
}
|
|
|
|
}
|