Package model
Class Terrain
java.lang.Object
model.Terrain
- All Implemented Interfaces:
Serializable
Implementation of Terrain class.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEntities
(Entity entity) Adds a new Entity to the tileReturns the entities on the tile in an ArrayList.int
Returns the speed modifier of the tile.int
Returns the version of the tile.getType()
Returns the type of the tile.void
setEntities
(ArrayList<Entity> entities) Sets the entities on the tile with an ArrayList.
-
Field Details
-
entities
An ArrayList of Entities on the tile. -
type
The type of the tile. -
speedMod
protected int speedModThe speed modifier of the tile. -
tileVersion
protected final int tileVersionThe version of the tile.
-
-
Constructor Details
-
Terrain
Constructs a new Terrain instance without entities.- Parameters:
type
- the type of tile
-
Terrain
Constructs a new Terrain instance without entities.- Parameters:
type
- the type of tileentities
- an ArrayList containing the entities
-
-
Method Details
-
getTileVersion
public int getTileVersion()Returns the version of the tile.- Returns:
- the version of the tile
-
getEntities
Returns the entities on the tile in an ArrayList.- Returns:
- the entities on the tile in an ArrayList
-
setEntities
Sets the entities on the tile with an ArrayList.- Parameters:
entities
- the entities to set on the tile in an ArrayList
-
addEntities
Adds a new Entity to the tile- Parameters:
entity
- a new Entity to add
-
getType
Returns the type of the tile.- Returns:
- the type of the tile
-
getSpeedMod
public int getSpeedMod()Returns the speed modifier of the tile.- Returns:
- the speed modifier of the tile
-