Class Bench
java.lang.Object
com.csse3200.game.entities.Entity
com.csse3200.game.entities.benches.Bench
This class is responsible for creating benches in the game.
Benches are static entities that can be interacted with by the player.
This initialiser handles applying the texture, scaling and collisions of the bench.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Entity
createBench
(String type) Creates visible bench.int
getX()
int
getY()
Methods inherited from class com.csse3200.game.entities.Entity
addComponent, create, dispose, earlyUpdate, equals, getCenterPosition, getComponent, getCreatedComponents, getEvents, getId, getPosition, getScale, hashCode, scaleHeight, scaleWidth, setEnabled, setPosition, setPosition, setPosition, setScale, setScale, toString, update
-
Field Details
-
type
-
x
public int x -
y
public int y
-
-
Constructor Details
-
Bench
initialiser creates a bench of a certain type at a location- Parameters:
type
- - file name of bench imagex
- - x coordinatey
- - y coordinate
-
-
Method Details
-
createBench
Creates visible bench.- Parameters:
type
- Type of bench- Returns:
- Station entity of given width and height with relevant behaviors
-
getX
public int getX() -
getY
public int getY()
-