MCPcopy Create free account
hub / github.com/MergHQ/CRYENGINE / PushAny

Method PushAny

Code/CryEngine/CryScriptSystem/ScriptSystem.cpp:1458–1500  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

1456
1457//////////////////////////////////////////////////////////////////////////
1458void CScriptSystem::PushAny(const ScriptAnyValue& var)
1459{
1460 switch (var.type)
1461 {
1462 case ANY_ANY:
1463 case ANY_TNIL:
1464 lua_pushnil(L);
1465 break;
1466 ;
1467 case ANY_TBOOLEAN:
1468 lua_pushboolean(L, var.b);
1469 break;
1470 ;
1471 case ANY_THANDLE:
1472 lua_pushlightuserdata(L, const_cast<void*>(var.ptr));
1473 break;
1474 case ANY_TNUMBER:
1475 lua_pushnumber(L, var.number);
1476 break;
1477 case ANY_TSTRING:
1478 lua_pushstring(L, var.str);
1479 break;
1480 case ANY_TTABLE:
1481 if (var.table)
1482 PushTable(var.table);
1483 else
1484 lua_pushnil(L);
1485 break;
1486 case ANY_TFUNCTION:
1487 lua_getref(L, (int)(INT_PTR)var.function);
1488 assert(lua_type(L, -1) == LUA_TFUNCTION);
1489 break;
1490 case ANY_TUSERDATA:
1491 lua_getref(L, var.ud.nRef);
1492 break;
1493 case ANY_TVECTOR:
1494 PushVec3(Vec3(var.vec3.x, var.vec3.y, var.vec3.z));
1495 break;
1496 default:
1497 // Must handle everything.
1498 assert(0);
1499 }
1500}
1501
1502//////////////////////////////////////////////////////////////////////////
1503bool CScriptSystem::ToAny(ScriptAnyValue& var, int index)

Callers 3

SetValueAnyMethod · 0.80
SetAtAnyMethod · 0.80
EndFunctionAnyMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected