Class GhostFactory
java.lang.Object
edu.uoc.pacman.model.entities.characters.ghosts.GhostFactory
Ghost Simple Factory class.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
GhostFactory
public GhostFactory()
-
-
Method Details
-
getGhostInstance
public static Ghost getGhostInstance(int x, int y, String ghostClassName, Direction direction, Behaviour behaviour, Level level) throws IllegalStateException Returns a newGhost
object.- Parameters:
x
- Column of the coordinate/position in which the item is in the board.y
- Row of the coordinate/position in which the item is in the board.ghostClassName
- String value of theMapItem
enumeration that corresponds to the item of the map.direction
- Direction which the ghost faces in the beginning.behaviour
- Current behaviour of the ghost.level
- Reference to theLevel
object.- Returns:
MapItem
object.- Throws:
IllegalStateException
- When a wrong symbol is used as an argument.
-