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

Function EnumOr

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

Source from the content-addressed store, hash-verified

64 }
65
66 [MonoPInvokeCallback(typeof(LuaCSFunction))]
67 public static int EnumOr(RealStatePtr L)
68 {
69 try
70 {
71 ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
72 object left = translator.FastGetCSObj(L, 1);
73 object right = translator.FastGetCSObj(L, 2);
74 Type typeOfLeft = left.GetType();
75 if (!typeOfLeft.IsEnum() || typeOfLeft != right.GetType())
76 {
77 return LuaAPI.luaL_error(L, "invalid argument for Enum BitwiseOr");
78 }
79 translator.PushAny(L, Enum.ToObject(typeOfLeft, Convert.ToInt64(left) | Convert.ToInt64(right)));
80 return 1;
81 }
82 catch (Exception e)
83 {
84 return LuaAPI.luaL_error(L, "c# exception in Enum BitwiseOr:" + e);
85 }
86 }
87
88 [MonoPInvokeCallback(typeof(LuaCSFunction))]
89 static int StaticCSFunction(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