(RealStatePtr L, int idx, object target)
| 333 | } |
| 334 | |
| 335 | private object getObject(RealStatePtr L, int idx, object target) |
| 336 | { |
| 337 | //return translator.getObject(L, idx); //TODO: translator.getObject move to here?? |
| 338 | LuaTypes type = (LuaTypes)LuaAPI.lua_type(L, idx); |
| 339 | switch (type) |
| 340 | { |
| 341 | case LuaTypes.LUA_TNUMBER: |
| 342 | { |
| 343 | if (LuaAPI.lua_isint64(L, idx)) |
| 344 | { |
| 345 | return LuaAPI.lua_toint64(L, idx); |
| 346 | } |
| 347 | else if(LuaAPI.lua_isinteger(L, idx)) |
| 348 | { |
| 349 | return LuaAPI.xlua_tointeger(L, idx); |
| 350 | } |
| 351 | else |
| 352 | { |
| 353 | return LuaAPI.lua_tonumber(L, idx); |
| 354 | } |
| 355 | } |
| 356 | case LuaTypes.LUA_TSTRING: |
| 357 | { |
| 358 | return LuaAPI.lua_tostring(L, idx); |
| 359 | } |
| 360 | case LuaTypes.LUA_TBOOLEAN: |
| 361 | { |
| 362 | return LuaAPI.lua_toboolean(L, idx); |
| 363 | } |
| 364 | case LuaTypes.LUA_TTABLE: |
| 365 | { |
| 366 | return getLuaTable(L, idx, null); |
| 367 | } |
| 368 | case LuaTypes.LUA_TFUNCTION: |
| 369 | { |
| 370 | return getLuaFunction(L, idx, null); |
| 371 | } |
| 372 | case LuaTypes.LUA_TUSERDATA: |
| 373 | { |
| 374 | if (LuaAPI.lua_isint64(L, idx)) |
| 375 | { |
| 376 | return LuaAPI.lua_toint64(L, idx); |
| 377 | } |
| 378 | else if(LuaAPI.lua_isuint64(L, idx)) |
| 379 | { |
| 380 | return LuaAPI.lua_touint64(L, idx); |
| 381 | } |
| 382 | else |
| 383 | { |
| 384 | object obj = translator.SafeGetCSObj(L, idx); |
| 385 | return (obj is RawObject) ? (obj as RawObject).Target : obj; |
| 386 | } |
| 387 | } |
| 388 | default: |
| 389 | return null; |
| 390 | } |
| 391 | } |
| 392 |
nothing calls this directly
no test coverage detected