Package dev.kyzel.game.world.tile
Class TileManager
java.lang.Object
dev.kyzel.game.world.tile.TileManager
A class to manage the tiles in the game.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Game
TheGame
where the all the tiles' information will write to.protected int
The max number of columns of the tiles list.protected int
The max number of rows of the tiles list.private double[][]
The list of number which is used to generate the map.protected Renderer
TheRenderer
where the all the tiles will be drawn on.protected Tile[][]
The list of all tiles. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Draws all the visible tiles.int
Gets the max number of columns of the tiles list.int
Gets the max number of rows of the tiles list.getTile
(int x, int y) Attempts to get a tile in the tiles list.Tile[][]
Gets a list of all tiles.void
Loads all tiles into the game.
-
Field Details
-
render
TheRenderer
where the all the tiles will be drawn on. -
game
TheGame
where the all the tiles' information will write to. -
maxRow
protected int maxRowThe max number of rows of the tiles list. -
maxCol
protected int maxColThe max number of columns of the tiles list. -
numberWorldTile
private double[][] numberWorldTileThe list of number which is used to generate the map. -
worldTiles
The list of all tiles.
-
-
Constructor Details
-
Method Details
-
getWorldTiles
Gets a list of all tiles.- Returns:
- an array of all tiles
-
getMaxRow
public int getMaxRow()Gets the max number of rows of the tiles list.- Returns:
- the max number of rows of the tiles list.
-
getMaxCol
public int getMaxCol()Gets the max number of columns of the tiles list.- Returns:
- the max number of columns of the tiles list.
-
getTile
Attempts to get a tile in the tiles list.- Parameters:
x
- the x coordinate of the tiley
- the y coordinate of the tile- Returns:
- the tile if the given values are in range, null otherwise
-
loadAllTexture
public void loadAllTexture()Loads all tiles into the game. -
drawAllTexture
Draws all the visible tiles.- Parameters:
g
- theGraphics
which is used to draw
-