local TraceFrame = DEFAULT_CHAT_FRAME;

DBmobs_Local_exist = "frFR";

DBmobs_Local_inverse = {};
DBmobs_Local_inverse_b = false;

function DBmobs_Local_OnLoad(self)

	self:RegisterEvent("VARIABLES_LOADED");

	--DBmobs_Local = {};
--TraceFrame:AddMessage("init DBmobs_Local_OnLoad");

end

function DBmobs_Local_OnEvent(self,event)

	if ( event == "" ) then
	elseif ( event == "VARIABLES_LOADED" ) then
		if ( DBCS_data_Mobs_noms_LOADED and DBCS_data_Mobs_noms_LOADED == true ) then
		else
			fDBmobs_Local_copier_client_vers_serveur(false);
		end
	end
	
end

function DBmobs_Local_Init_Inverse()

local i;
local snom;
local j;

	if ( DBmobs_Local_inverse_b == false ) then
--if ( DBCS_debug and DBCS_debug > 1 ) then
--TraceFrame:AddMessage("init DBmobs_Local_Init_Inverse");
--end
		j = 0;
		DBmobs_Local_inverse = {};
		for i, _ in pairs(DBmobs_Local) do
			snom = nil;
			if ( DBmobs_Local[i][1] ) then
				snom = DBmobs_Local[i][1][1];
			end
			if ( snom ) then
				--j = j + 1;
				--if ( j < 100 ) then
--if ( DBCS_debug and DBCS_debug > 1 ) then
--TraceFrame:AddMessage("DBmobs_Local_OnEvent : "..snom.." = "..i);
--end
				--end
				if ( DBmobs_Local_inverse[snom] == nil ) then
					DBmobs_Local_inverse[snom] = {};
					j = j + 1;
				end
				table.insert(DBmobs_Local_inverse[snom],i);
			end
		end
--if ( DBCS_debug and DBCS_debug > 1 ) then
--TraceFrame:AddMessage("DBmobs_Local_Init_Inverse : "..j.." noms.");
--end
		DBmobs_Local_inverse_b = true;
	end

end
