defense_mob_api = {}


local modpath = minetest.get_modpath("defense_mob_api")
local function dofile2(file)
	return dofile(modpath .. "/" .. file)
end

local time_speed = minetest.setting_get("time_speed")
function defense_mob_api:get_day_count()
	return math.floor(minetest.get_gametime() * time_speed / 86400)
end

function defense_mob_api:is_dark()
	local tod = minetest.get_timeofday()
	return tod < 0.2 or tod > 0.8 --or defense.debug
end

function defense_mob_api:log(message)
	if self.debug then
		minetest.chat_send_all("[debug] " .. message)
	end
	minetest.debug(message)
end


dofile2("pathfinder.lua")
defense_mob_api.Swarm = dofile2("swarm.lua")
dofile2("mob.lua")
dofile2("debug.lua")
