public class Receptacle extends Interactable implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
recyclingYpos
y Location of the recycling bin Receptacle in the game
|
(package private) ReceptacleType |
rType
The type of Receptacle this object is.
|
static int |
trashYpos
y Location of the trash bin Recptacle in the game
|
height, width, xLocation, yLocation
Constructor and Description |
---|
Receptacle(int rWidth,
int rHeight,
ReceptacleType rType)
Constructor for Receptacle objects.
|
Modifier and Type | Method and Description |
---|---|
ReceptacleType |
getType()
Method that returns the ReceptacleType
|
void |
takeLitter(Player p,
Model model)
Method that removes Litter from the player object
|
addXLocation, addYLocation, getCollidesWith, getCollisionRect, getHeight, getWidth, getXLocation, getYLocation, setRelativeCollisionRect, setXLocation, setYLocation
ReceptacleType rType
public static int trashYpos
public static int recyclingYpos
public Receptacle(int rWidth, int rHeight, ReceptacleType rType)
rWidth
- The width of the Receptacle object.rHeight
- the height of the Receptacle objectrType
- Enum value corresponding to the Receptacle type.public void takeLitter(Player p, Model model)
p
- the player Object interacting with the receptaclepublic ReceptacleType getType()