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 Game
TheGame
where the minimap will take information from.private int
The minimap's size.private int
The max number of columns of tiles list.private int
The max number of rows of the tiles list.private Renderer
TheRenderer
where the minimap will be drawn on.(package private) BufferedImage
The output minimap.private Tile[][]
The list of all tiles in the game. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Creates the minimap.void
Draws the minimap.int
Gets the minimap's size.void
setMapSize
(int mapSize) Set the minimap's size to the given value.void
update()
Updates the minimap.
-
Field Details
-
render
TheRenderer
where the minimap will be drawn on. -
game
TheGame
where 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
- theGraphics
which is used to draw
-