Package edu.uoc.pacman.model.entities
Class Entity
java.lang.Object
edu.uoc.pacman.model.entities.Entity
Represents any item that appears in the game.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the current position of the entity.Getter of the attributesprite
.boolean
Getter of the attributepathable
.void
setPathable
(boolean pathable) Setter of the attributepathable
.void
setPosition
(Position position) Sets the position of the entity.protected void
Setter of the attributesprite
.
-
Field Details
-
position
Position where the entity is. -
pathable
private boolean pathableIndicates if the entity is pathable or not. -
sprite
Value ofSprite
linked to the entity.
-
-
Constructor Details
-
Entity
Constructor with arguments.- Parameters:
position
- Initial value of the attributeposition
.pathable
- Initial value of the attributepathable
.sprite
- Initial value of the attributesprite
.
-
-
Method Details
-
getPosition
Gets the current position of the entity.- Returns:
- current position.
-
setPosition
Sets the position of the entity. If position is null, then the position is not set.- Parameters:
position
- to set to the entity
-
isPathable
public boolean isPathable()Getter of the attributepathable
.- Returns:
- Current value of
pathable
.
-
setPathable
public void setPathable(boolean pathable) Setter of the attributepathable
.- Parameters:
pathable
- New value for the attributepathable
.
-
getSprite
Getter of the attributesprite
.- Returns:
- Current value of
sprite
.
-
setSprite
Setter of the attributesprite
.- Parameters:
sprite
- New value for the attributesprite
.
-