diff --git a/src/main/java/inf112/fiasko/roborally/element_properties/IGrid.java b/src/main/java/inf112/fiasko/roborally/element_properties/IGrid.java new file mode 100644 index 0000000..29f0a4c --- /dev/null +++ b/src/main/java/inf112/fiasko/roborally/element_properties/IGrid.java @@ -0,0 +1,37 @@ +package inf112.fiasko.roborally.element_properties; + +/** + * This Interface describes a grid + * @param type of element + */ +public interface IGrid { + + /** + * returns the width of the grid + * @return the width + */ + int getWidth(); + + /** + * returns the height of the grid + * @return the height + */ + int getHeight(); + + /** + * returns the element in a given x and y coordinate + * @param x coordinate in the grid + * @param y coordinate in the grid + * @return element in the x and y coordinate + * @throws IllegalArgumentException throws exception if coordinates are not in the grid + */ + K getElement(int x,int y) throws IllegalArgumentException; + + /** + * places the element in the given x and y coordinate + * @param x coordinate + * @param y coordinate + * @param element that is being placed in the grid + */ + void setElement(int x, int y, K element); +}