local _, addon = ...

local function ResolveGender()
    local gender = UnitSex("player")
    if gender == 2 then
        return 'M'
    else
        return 'F'
    end
end
addon.API.ResolveGender = ResolveGender

function CzechQuestsAddon:GetData(key, id)
    local gender = ResolveGender()
    if addon.data[key] then
        if key == "quest" then
            return addon.API.GetQuest(id, gender)
        elseif key == "book" then
            return addon.API.GetBook(id, gender)
        elseif key == "speech" then
            return addon.API.GetSpeech(id)
        elseif key == "encounter" then
            return addon.API.GetEncounter(id)
        elseif addon.data[key][id] then
            return addon.data[key][id]
        end
    end
    return nil
end
