-- selene: allow(unscoped_variables)
dbg = {}

-- selene: allow(unused_variable)
function dbg.label(value, name)
    if type(value) == "table" then
        print(name .. ":")
        printTable(value)
    elseif type(value) == "boolean" then
        if value then
            print(name .. ": " .. (value and "true" or "false"))
        end
    elseif value ~= nil then
        print(name .. ": " .. value)
    else
        print(name .. ": nil")
    end
    return value
end

-- Only works if called with the bases empty (i.e. the only runner should be the batter.
-- selene: allow(unused_variable)
function dbg.loadTheBases(baseConstants, runners)
    newRunner()
    newRunner()
    newRunner()
    runners[2].x = baseConstants[1].x
    runners[2].y = baseConstants[1].y
    runners[2].nextBase = baseConstants[2]

    runners[3].x = baseConstants[2].x
    runners[3].y = baseConstants[2].y
    runners[3].nextBase = baseConstants[3]

    runners[4].x = baseConstants[3].x
    runners[4].y = baseConstants[3].y
    runners[4].nextBase = baseConstants[4]
end

if not playdate then
    return dbg
end
