Class ObjectToLuaTable
- Namespace
- Cobilas.GodotEngine.GDLua
- Assembly
- com.cobilas.godot.lua.dll
Provides a base class for converting between C# objects and Lua tables.
public abstract class ObjectToLuaTable
- Inheritance
-
ObjectToLuaTable
- Inherited Members
Remarks
This abstract class serves as the foundation for type-specific converters that handle serialization and deserialization between C# objects and Lua tables in the Godot engine's Lua integration system.
Methods
ToLuaTable(object?, LuaTable?)
Converts a C# object to a Lua table.
public abstract void ToLuaTable(object? obj, LuaTable? table)
Parameters
objobjectThe C# object to convert.
tableLuaTableThe Lua table to populate with the object's data.
ToObject(object?, LuaTable?)
Converts a Lua table back to a C# object.
public abstract object ToObject(object? obj, LuaTable? table)
Parameters
objobjectThe original object instance (may be used for context).
tableLuaTableThe Lua table containing the serialized data.
Returns
- object
A C# object reconstructed from the Lua table data.
TryGetValue(Type, out ObjectToLuaTable)
Attempts to retrieve a converter for the specified type.
public static bool TryGetValue(Type type, out ObjectToLuaTable value)
Parameters
typeTypeThe type to find a converter for.
valueObjectToLuaTableWhen this method returns, contains the converter associated with the specified type, if found; otherwise, null.
Returns
- bool
true if a converter for the specified type was found; otherwise, false.