Class EmptyMap

  • All Implemented Interfaces:
    SceneMap

    public final class EmptyMap
    extends java.lang.Object
    implements SceneMap
    A Null Object implementation of SceneMap.
    • Constructor Detail

      • EmptyMap

        public EmptyMap​(@NotNull
                        @NotNull Scene scene)
    • Method Detail

      • getGridWidth

        public int getGridWidth()
        Specified by:
        getGridWidth in interface SceneMap
        Returns:
        width of the map tile grid (unit: tile)
      • getGridHeight

        public int getGridHeight()
        Specified by:
        getGridHeight in interface SceneMap
        Returns:
        height of the map tile grid (unit: tile)
      • getTileWidth

        public int getTileWidth()
        Specified by:
        getTileWidth in interface SceneMap
        Returns:
        width of a single tile (unit: pixel)
      • getTileHeight

        public int getTileHeight()
        Specified by:
        getTileHeight in interface SceneMap
        Returns:
        height of a single tile (unit: pixel)
      • getOverlay

        @NotNull
        public @NotNull Overlay getOverlay()
        Specified by:
        getOverlay in interface SceneMap
        Returns:
        map overlay layer
      • getTile

        @NotNull
        public @NotNull MapTile getTile​(int tileX,
                                        int tileY)
        Description copied from interface: SceneMap
        Gets a tile at specified grid position.
        Specified by:
        getTile in interface SceneMap
        Parameters:
        tileX - x position of the tile in grid
        tileY - y position of the tile in grid
        Returns:
        tile at specified grid position
      • intersectsWithWall

        public boolean intersectsWithWall​(@NotNull
                                          @NotNull Actor actor)
        Specified by:
        intersectsWithWall in interface SceneMap
        Parameters:
        actor - actor to check for intersection
        Returns:
        true if the specified actor intersects with a wall in the map
      • render

        public void render​(float deltaTime)
        Description copied from interface: SceneMap
        Renders the map.
        Specified by:
        render in interface SceneMap
        Parameters:
        deltaTime - time passed from since the previous render