def get_tile_index(letter, mapping):
    """
    lookups up the letter in the tileset definition
    and returns the grid index (single value for TMX)
    """
    if letter in mapping:
        return mapping[letter]
    else:
        return 0
