EpicKnarvik97 a0ba1511b3 Endrer navn på java grensesnitt og kjører automatisk reformatering av objekter og objekttester
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
2020-04-20 13:13:04 +02:00

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;
}