Package edu.uoc.pacman.model.utils
Enum Class Sprite
- All Implemented Interfaces:
Serializable
,Comparable<Sprite>
,Constable
Sprite that stores the configuration file symbol and the image's path.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSprite for a Blinky ghost.Sprite for a Clyde ghost.Sprite for a dot.Sprite for an energizer.Sprite for an Inky ghost.Sprite for a life.Sprite when Pacman is facing down.Sprite when Pacman is facing left.Sprite when Pacman is facing right.Sprite when Pacman is facing up.Sprite for a piece of path.Sprite for a Pinky ghost.Sprite for a wall. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGetter of the attributeimageSrc
.char
Getter of the attributesymbol
.static Sprite
Returns the enum constant of this class with the specified name.static Sprite[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PACMAN_RIGHT
Sprite when Pacman is facing right. -
PACMAN_LEFT
Sprite when Pacman is facing left. -
PACMAN_UP
Sprite when Pacman is facing up. -
PACMAN_DOWN
Sprite when Pacman is facing down. -
BLINKY
Sprite for a Blinky ghost. -
PINKY
Sprite for a Pinky ghost. -
INKY
Sprite for an Inky ghost. -
CLYDE
Sprite for a Clyde ghost. -
DOT
Sprite for a dot. -
ENERGIZER
Sprite for an energizer. -
WALL
Sprite for a wall. -
PATH
Sprite for a piece of path. -
LIFE
Sprite for a life.
-
-
Field Details
-
symbol
private final char symbolValue in the configuration file. -
imageSrc
Value of the image path.
-
-
Constructor Details
-
Sprite
Constructor with arguments.- Parameters:
symbol
- Value of the configuration file symbol.imageSrc
- Value of the image path.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getSymbol
public char getSymbol()Getter of the attributesymbol
.- Returns:
- Current value of the attribute
symbol
.
-
getImageSrc
Getter of the attributeimageSrc
.- Returns:
- Current value of the attribute
imageSrc
.
-