Пример #1
0
		private StkId T_GetTMByObj( ref TValue o, TMS tm )
		{
			LuaTable mt = null;

			switch( o.Tt )
			{
				case (int)LuaType.LUA_TTABLE:
				{
					var tbl = o.HValue();
					mt = tbl.MetaTable;
					break;
				}
				case (int)LuaType.LUA_TUSERDATA:
				{
					var ud = o.RawUValue();
					mt = ud.MetaTable;
					break;
				}
				default:
				{
					mt = G.MetaTables[o.Tt];
					break;
				}
			}
			return (mt != null)
				 ? mt.GetStr( GetTagMethodName( tm ) )
				 : TheNilValue;
		}
Пример #2
0
        private StkId T_GetTMByObj(ref TValue o, TMS tm)
        {
            LuaTable mt = null;

            switch (o.Tt)
            {
            case (int)LuaType.LUA_TTABLE:
            {
                LuaTable tbl = o.HValue();
                mt = tbl.MetaTable;
                break;
            }

            case (int)LuaType.LUA_TUSERDATA:
            {
                LuaUserDataValue ud = o.RawUValue();
                mt = ud.MetaTable;
                break;
            }

            default:
            {
                mt = G.MetaTables[o.Tt];
                break;
            }
            }
            return((mt != null)
                                 ? mt.GetStr(GetTagMethodName(tm))
                                 : TheNilValue);
        }