Package com.deco2800.game.entities
Class Tile
java.lang.Object
com.deco2800.game.entities.Tile
Class representing a 'Tile' in the game world. Only one entity can occupy any one tile at any point in time.
Provides methods for getting and setting Tiles.
-
Constructor Summary
ConstructorsConstructorDescriptionTile()
Creates a new Tile object and initialises it with default values.Creates a new Tile object and initialises it with a given EntityCreates a new Tile object and initialises it with a given tileTypeCreates a new Tile object and initialises it with the provided values for tileType and entity -
Method Summary
Modifier and TypeMethodDescriptionvoid
Sets the Tile's entity parameter to null.Returns the entity contained by the tile or null if none presentReturns the tile's typevoid
Sets the entity parameter of the tilevoid
setTileType
(String tileType) Sets the tileType parameter of the tile
-
Constructor Details
-
Tile
public Tile()Creates a new Tile object and initialises it with default values. -
Tile
Creates a new Tile object and initialises it with a given tileType- Parameters:
tileType
- string
-
Tile
Creates a new Tile object and initialises it with a given Entity- Parameters:
entity
-
-
Tile
Creates a new Tile object and initialises it with the provided values for tileType and entity- Parameters:
tileType
- stringentity
- Entity
-
-
Method Details
-
setTileType
Sets the tileType parameter of the tile- Parameters:
tileType
- string
-
setEntity
Sets the entity parameter of the tile- Parameters:
entity
-
-
getTileType
Returns the tile's type- Returns:
- string
-
getEntity
Returns the entity contained by the tile or null if none present- Returns:
- Entity
-
clearTile
public void clearTile()Sets the Tile's entity parameter to null.
-