local function O(O)for V,b in pairs(checkpoints)do if b.CollisionBody==O then return b end end return nil end local function V(O,V)for b,i in pairs(checkpoints)do if i:PlayerLapPassed(O,V)~=V then return false end end return true end local function b(O)racers[O]=Racer.new()end local function i()for O,V in pairs(racers)do if not V:HasFinishedLap(numLaps)then return false end end return true end
-- ================================================================================
-- LOCAL FUNCTIONS
-- ================================================================================
local function getCheckpointFromPart(part)
	for _, checkpoint in pairs(checkpoints) do
		if checkpoint.CollisionBody == part then
			return checkpoint
		end
	end
	return nil
end -- getCheckpointFromPart()

local function hasPlayerFinishedLap(player, lap)
	for _, checkpoint in pairs(checkpoints) do
		if checkpoint:PlayerLapPassed(player, lap) ~= lap then
			return false
		end
	end
	return true
end -- hasPlayerFinishedLap()

local function addRacer(player)
	racers[player] = Racer.new()
end -- addRacer()

local function checkAllFinished()
	for _, racer in pairs(racers) do
		if not racer:HasFinishedLap(numLaps) then
			return false
		end
	end
	return true
end -- checkAllFinished()
