Class MapItemFactory

java.lang.Object
edu.uoc.pacman.model.entities.items.MapItemFactory

public abstract class MapItemFactory extends Object
Entity Simple Factory class.
  • Constructor Details

    • MapItemFactory

      public MapItemFactory()
  • Method Details

    • getItemMapInstance

      public static MapItem getItemMapInstance(int x, int y, char itemMapSymbol) throws IllegalStateException
      Returns a new MapItem 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.
      itemMapSymbol - String value of the MapItem enumeration that corresponds to the item of the map.
      Returns:
      MapItem object.
      Throws:
      IllegalStateException - When a wrong symbol is used as an argument.