local game = require("main_state")

local function getDiffColor(op)
    local diff = tonumber(game.number(op))
    if diff < 0 then
        return 192
    end
    return 10
end

local function getSongData(judgeX, judgeY, judgeFontHeight, judgeOffset)
    return {
        -- song data + playdata
        {
            id = "bg_song",
            dst = {
                { x = judgeX - 10, y = judgeY - 305, w = 1220, h = 376, a = 255, filter = 1 }
            }
        },
        {
            id = "text_title",
            dst = {
                { x = judgeX + 60, y = judgeY + 12, w = 960, h = 40, a = 255, r = 255, g = 255, b = 255, filter = 1 }
            }
        },
        {
            id = "text_level",
            dst = {
                { x = judgeX, y = judgeY - judgeOffset * 7 - 20, w = 150, h = 40, a = 255, r = 10, g = 10, b = 10, filter = 1 }
            }
        },
        -- playdata
        {
            id = "pgreat",
            dst = {
                { x = judgeX, y = judgeY - judgeOffset * 1, w = 300, h = judgeFontHeight, a = 255, r = 10, g = 10, b = 10 }
            }
        },
        {
            id = "great",
            dst = {
                { x = judgeX, y = judgeY - judgeOffset * 2, w = 300, h = judgeFontHeight, a = 255, r = 10, g = 10, b = 10 }
            }
        },
        {
            id = "good",
            dst = {
                { x = judgeX, y = judgeY - judgeOffset * 3, w = 300, h = judgeFontHeight, a = 255, r = 10, g = 10, b = 10 }
            }
        },
        {
            id = "bad",
            dst = {
                { x = judgeX, y = judgeY - judgeOffset * 4, w = 300, h = judgeFontHeight, a = 255, r = 10, g = 10, b = 10 }
            }
        },
        {
            id = "poor",
            dst = {
                { x = judgeX, y = judgeY - judgeOffset * 5, w = 300, h = judgeFontHeight, a = 255, r = 10, g = 10, b = 10 }
            }
        },
        {
            id = "expoor",
            dst = {
                { x = judgeX, y = judgeY - judgeOffset * 6, w = 300, h = judgeFontHeight, a = 255, r = 10, g = 10, b = 10 }
            }
        },
        {
            id = "exscore",
            dst = {
                { x = judgeX + 275, y = judgeY - judgeOffset * 1, w = 300, h = judgeFontHeight, a = 255, r = 10, g = 10, b = 10 }
            }
        },
        {
            id = "exscore_diff",
            dst = {
                { x = judgeX + 275, y = judgeY - judgeOffset * 2, w = 300, h = judgeFontHeight, a = 255, r = getDiffColor(172), g = 10, b = 10 }
            }
        },
        {
            id = "exscore_diff_target",
            dst = {
                { x = judgeX + 275, y = judgeY - judgeOffset * 3, w = 300, h = judgeFontHeight, a = 255, r = getDiffColor(153), g = 10, b = 10 }
            }
        },
        -- fastslow
        {
            id = "total_fast",
            dst = {
                { x = judgeX + 275, y = judgeY - judgeOffset * 5, w = 300, h = judgeFontHeight, a = 255, r = 10, g = 140, b = 180 }
            }
        },
        {
            id = "total_slow",
            dst = {
                { x = judgeX + 275, y = judgeY - judgeOffset * 6, w = 300, h = judgeFontHeight, a = 255, r = 140, g = 10, b = 10 }
            }
        },
    }
end

return {
    getSongData = getSongData
}
