java.lang.Object
edu.uoc.pacman.model.entities.characters.ghosts.GhostFactory

public abstract class GhostFactory extends Object
Ghost Simple Factory class.
  • 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 new Ghost 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 the MapItem 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 the Level object.
      Returns:
      MapItem object.
      Throws:
      IllegalStateException - When a wrong symbol is used as an argument.