44 lines
1.1 KiB
Lua
44 lines
1.1 KiB
Lua
-- 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(br)
|
|
br:pushNewBatter()
|
|
br:pushNewBatter()
|
|
br:pushNewBatter()
|
|
|
|
br.runners[2].x = C.Bases[C.First].x
|
|
br.runners[2].y = C.Bases[C.First].y
|
|
br.runners[2].nextBase = C.Bases[C.Second]
|
|
|
|
br.runners[3].x = C.Bases[C.Second].x
|
|
br.runners[3].y = C.Bases[C.Second].y
|
|
br.runners[3].nextBase = C.Bases[C.Third]
|
|
|
|
br.runners[4].x = C.Bases[C.Third].x
|
|
br.runners[4].y = C.Bases[C.Third].y
|
|
br.runners[4].nextBase = C.Bases[C.Home]
|
|
end
|
|
|
|
if not playdate then
|
|
return dbg
|
|
end
|