--------------------------------------------------------------------------------
-- 文件: global_value.lua
-- 日期: 2013-12-06
-- 作者: 盒子哥
-- 描述: 及接口全局变量
--------------------------------------------------------------------------------
local common = LibStub("LibAddon"):GetAddon("common")

function common:add_global(key, value)	
	if (type(key) == "table") then
		for k, v in pairs(key) do
			self:add_global(k, v)
		end
	elseif (type(key) == "string") then
		if (self.global[key]) then
			geterrorhandler()("common:add_globale(key, value) failed. 'key' "..key.." exist.")
		end

		self.global[key] = value
	else
		geterrorhandler()("common:add_global(key, value): 'key'  - string expected.")
	end	
end

-- 脚本返回值,可以是任何类型(table,string,int)
common:add_global("g_result_info", -1)
common:add_global("g_first_set_move", false)
