//this source code was auto-generated by tolua#, do not modify it
using System;
using LuaInterface;

public class LanguageMgrWrap
{
	public static void Register(LuaState L)
	{
		L.BeginClass(typeof(LanguageMgr), typeof(System.Object));
		L.RegFunction("Init", Init);
		L.RegFunction("ChangeLanguageType", ChangeLanguageType);
		L.RegFunction("New", _CreateLanguageMgr);
		L.RegFunction("__tostring", ToLua.op_ToString);
		L.RegVar("language", get_language, set_language);
		L.RegVar("languageIndex", get_languageIndex, null);
		L.RegVar("instance", get_instance, null);
		L.EndClass();
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int _CreateLanguageMgr(IntPtr L)
	{
		try
		{
			int count = LuaDLL.lua_gettop(L);

			if (count == 0)
			{
				LanguageMgr obj = new LanguageMgr();
				ToLua.PushObject(L, obj);
				return 1;
			}
			else
			{
				return LuaDLL.luaL_throw(L, "invalid arguments to ctor method: LanguageMgr.New");
			}
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int Init(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 1);
			LanguageMgr obj = (LanguageMgr)ToLua.CheckObject(L, 1, typeof(LanguageMgr));
			obj.Init();
			return 0;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int ChangeLanguageType(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 2);
			LanguageMgr obj = (LanguageMgr)ToLua.CheckObject(L, 1, typeof(LanguageMgr));
			int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
			obj.ChangeLanguageType(arg0);
			return 0;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int get_language(IntPtr L)
	{
		object o = null;

		try
		{
			o = ToLua.ToObject(L, 1);
			LanguageMgr obj = (LanguageMgr)o;
			LanguageType ret = obj.language;
			ToLua.Push(L, ret);
			return 1;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index language on a nil value" : e.Message);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int get_languageIndex(IntPtr L)
	{
		object o = null;

		try
		{
			o = ToLua.ToObject(L, 1);
			LanguageMgr obj = (LanguageMgr)o;
			int ret = obj.languageIndex;
			LuaDLL.lua_pushinteger(L, ret);
			return 1;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index languageIndex on a nil value" : e.Message);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int get_instance(IntPtr L)
	{
		try
		{
			ToLua.PushObject(L, LanguageMgr.instance);
			return 1;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int set_language(IntPtr L)
	{
		object o = null;

		try
		{
			o = ToLua.ToObject(L, 1);
			LanguageMgr obj = (LanguageMgr)o;
			LanguageType arg0 = (LanguageType)ToLua.CheckObject(L, 2, typeof(LanguageType));
			obj.language = arg0;
			return 0;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index language on a nil value" : e.Message);
		}
	}
}

