MCPcopy Create free account
hub / github.com/Tencent/xLua / EnumAnd

Function EnumAnd

Assets/XLua/Src/StaticLuaCallbacks.cs:44–64  ·  view source on GitHub ↗
(RealStatePtr L)

Source from the content-addressed store, hash-verified

42 }
43
44 [MonoPInvokeCallback(typeof(LuaCSFunction))]
45 public static int EnumAnd(RealStatePtr L)
46 {
47 try
48 {
49 ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
50 object left = translator.FastGetCSObj(L, 1);
51 object right = translator.FastGetCSObj(L, 2);
52 Type typeOfLeft = left.GetType();
53 if (!typeOfLeft.IsEnum() || typeOfLeft != right.GetType())
54 {
55 return LuaAPI.luaL_error(L, "invalid argument for Enum BitwiseAnd");
56 }
57 translator.PushAny(L, Enum.ToObject(typeOfLeft, Convert.ToInt64(left) & Convert.ToInt64(right)));
58 return 1;
59 }
60 catch (Exception e)
61 {
62 return LuaAPI.luaL_error(L, "c# exception in Enum BitwiseAnd:" + e);
63 }
64 }
65
66 [MonoPInvokeCallback(typeof(LuaCSFunction))]
67 public static int EnumOr(RealStatePtr L)

Callers

nothing calls this directly

Calls 5

FindMethod · 0.80
FastGetCSObjMethod · 0.80
IsEnumMethod · 0.80
luaL_errorMethod · 0.80
PushAnyMethod · 0.80

Tested by

no test coverage detected