lib/demiurge/tmx.rb
def tmx_entry(layout_type, layout_filename)
      @tile_cache ||= {}
      @tile_cache[layout_type] ||= {}
      if @tile_cache[layout_type][layout_filename]
        return @tile_cache[layout_type][layout_filename]
      end

      if layout_type == "manasource"
        @tile_cache[layout_type][layout_filename] = sprites_from_manasource_tmx(layout_filename)
      elsif layout_type == "tmx"
        @tile_cache[layout_type][layout_filename] = sprites_from_tmx(layout_filename)
      else
        raise "A TMX location must have a known type of layout (tmx or manasource), not #{layout_type.inspect}!"
      end

      @tile_cache[layout_type][layout_filename]
    end
# Return a TMX entry for the given layout type and filename. A
# "layout type" is something like normal TMX (called "tmx") or
# Manasource-style (called "manasource".) But additional types are
# likely to be added in future versions of Pixiurge.
#
# @param layout_type [String] The subtype of TMX file; currently may be one of "tmx" or "manasource"
# @param layout_filename [String] The path to the TMX file relative to the tile cache's TMX root directory
# @return [Hash] The TMX cache entry, in an internal and potentially changeable format
# @api private
# @since 0.3.0
Return a TMX entry for the given layout type and filename.
Return a TMX entry for the given layout type and filename .
def tmx_entry(layout_type, layout_filename)
      @tile_cache ||= {}
      @tile_cache[layout_type] ||= {}
      if @tile_cache[layout_type][layout_filename]
        return @tile_cache[layout_type][layout_filename]
      end
      if layout_type == "manasource"
        @tile_cache[layout_type][layout_filename] = sprites_from_manasource_tmx(layout_filename)
      elsif layout_type == "tmx"
        @tile_cache[layout_type][layout_filename] = sprites_from_tmx(layout_filename)
      else
        raise "A TMX location must have a known type of layout (tmx or manasource), not #{layout_type.inspect}!"
      end
      @tile_cache[layout_type][layout_filename]
    end
def tmx_entry ( layout_type , layout_filename ) @tile_cache ||= { } @tile_cache [ layout_type ] ||= { } if @tile_cache [ layout_type ] [ layout_filename ] return @tile_cache [ layout_type ] [ layout_filename ] end if layout_type == "manasource" @tile_cache [ layout_type ] [ layout_filename ] = sprites_from_manasource_tmx ( layout_filename ) elsif layout_type == "tmx" @tile_cache [ layout_type ] [ layout_filename ] = sprites_from_tmx ( layout_filename ) else raise "A TMX location must have a known type of layout (tmx or manasource), not #{layout_type.inspect}!" end @tile_cache [ layout_type ] [ layout_filename ] end
Return a TMX entry for the given layout type and filename.
Return a TMX entry for the given layout type and filename .
The TMX cache entry, in an internal and potentially changeable format
The TMX cache entry in an internal and potentially changeable format
Hash
layout_type
The subtype of TMX file; currently may be one of "tmx" or "manasource"
The subtype of TMX file ; currently may be one of " tmx " or " manasource "
layout_filename
The path to the TMX file relative to the tile cache's TMX root directory
The path to the TMX file relative to the tile cache ' s TMX root directory
api
None
since
None