Package dev.kyzel.game.world.tile
Class Minimap
java.lang.Object
dev.kyzel.game.world.tile.Minimap
A class to handle minimap.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate GameTheGamewhere the minimap will take information from.private intThe minimap's size.private intThe max number of columns of tiles list.private intThe max number of rows of the tiles list.private RendererTheRendererwhere the minimap will be drawn on.(package private) BufferedImageThe output minimap.private Tile[][]The list of all tiles in the game. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCreates the minimap.voidDraws the minimap.intGets the minimap's size.voidsetMapSize(int mapSize) Set the minimap's size to the given value.voidupdate()Updates the minimap.
-
Field Details
-
render
TheRendererwhere the minimap will be drawn on. -
game
TheGamewhere the minimap will take information from. -
worldTiles
The list of all tiles in the game. -
maxRow
private int maxRowThe max number of rows of the tiles list. -
maxCol
private int maxColThe max number of columns of tiles list. -
worldMap
BufferedImage worldMapThe output minimap. -
mapSize
private int mapSizeThe minimap's size.
-
-
Constructor Details
-
Method Details
-
getMapSize
public int getMapSize()Gets the minimap's size.- Returns:
- the minimap's size
-
setMapSize
public void setMapSize(int mapSize) Set the minimap's size to the given value.- Parameters:
mapSize- the given value
-
update
public void update()Updates the minimap. -
createMinimap
public void createMinimap()Creates the minimap. -
draw
Draws the minimap.- Parameters:
g- theGraphicswhich is used to draw
-