mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-04-21 11:06:24 +02:00
Endrer IInteractabaleGame til InteractableGame Endrer IDrawableGame til DrawableGame Endrer IDeck til Deck Endrer IGrid til Grid Endrer Grid til ListGrid Endrer Deck til AbstractDeck Endrer PowerdownContainer til PowerDownContainer Endrer GridTest til ListGridTest Kjører IntelliJ sin automatiske reformatering for å fikse formateringsfeil
43 lines
1.1 KiB
Java
43 lines
1.1 KiB
Java
package inf112.fiasko.roborally.objects;
|
|
|
|
/**
|
|
* This Interface describes a grid
|
|
*
|
|
* @param <K> The type of element the grid is to store
|
|
*/
|
|
public interface Grid<K> {
|
|
|
|
/**
|
|
* Gets the width of the grid
|
|
*
|
|
* @return The width of the grid
|
|
*/
|
|
int getWidth();
|
|
|
|
/**
|
|
* Gets height of the grid
|
|
*
|
|
* @return The height of the grid
|
|
*/
|
|
int getHeight();
|
|
|
|
/**
|
|
* Gets 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 an exception if the coordinates are outside of the grid
|
|
*/
|
|
K getElement(int x, int y) throws IllegalArgumentException;
|
|
|
|
/**
|
|
* Places the element on the given x and y coordinate
|
|
*
|
|
* @param x Coordinate in the grid
|
|
* @param y Coordinate in the grid
|
|
* @param element The element to place in the grid
|
|
*/
|
|
void setElement(int x, int y, K element) throws IllegalArgumentException;
|
|
}
|