(RealStatePtr L, object o)
| 1127 | } |
| 1128 | |
| 1129 | public void PushAny(RealStatePtr L, object o) |
| 1130 | { |
| 1131 | if (o == null) |
| 1132 | { |
| 1133 | LuaAPI.lua_pushnil(L); |
| 1134 | return; |
| 1135 | } |
| 1136 | |
| 1137 | Type type = o.GetType(); |
| 1138 | if (type.IsPrimitive()) |
| 1139 | { |
| 1140 | pushPrimitive(L, o); |
| 1141 | } |
| 1142 | else if (o is string) |
| 1143 | { |
| 1144 | LuaAPI.lua_pushstring(L, o as string); |
| 1145 | } |
| 1146 | else if (type == typeof(byte[])) |
| 1147 | { |
| 1148 | LuaAPI.lua_pushstring(L, o as byte[]); |
| 1149 | } |
| 1150 | else if (o is decimal) |
| 1151 | { |
| 1152 | PushDecimal(L, (decimal)o); |
| 1153 | } |
| 1154 | else if (o is LuaBase) |
| 1155 | { |
| 1156 | ((LuaBase)o).push(L); |
| 1157 | } |
| 1158 | else if (o is LuaCSFunction) |
| 1159 | { |
| 1160 | Push(L, o as LuaCSFunction); |
| 1161 | } |
| 1162 | else if (o is ValueType) |
| 1163 | { |
| 1164 | PushCSObject push; |
| 1165 | if (custom_push_funcs.TryGetValue(o.GetType(), out push)) |
| 1166 | { |
| 1167 | push(L, o); |
| 1168 | } |
| 1169 | else |
| 1170 | { |
| 1171 | Push(L, o); |
| 1172 | } |
| 1173 | } |
| 1174 | else |
| 1175 | { |
| 1176 | Push(L, o); |
| 1177 | } |
| 1178 | } |
| 1179 | |
| 1180 | Dictionary<object, int> enumMap = new Dictionary<object, int>(); |
| 1181 |
no test coverage detected