C#辞書とリスト回転LuaTable

3363 ワード

function DicToLuaTable(Dic)
    -- C# Dic  Lua Table
    local dic = {}
    if Dic then
        local iter = Dic:GetEnumerator()
        while iter:MoveNext() do
            local k = iter.Current.Key
            local v = iter.Current.Value
            dic[k] = v
        end
    end
    return dic
end


function ListToTable(List)
    -- C# List  Lua Table
    local list = {}
    if List then
        local index = 1
        local iter = List:GetEnumerator()
        while iter:MoveNext() do
            local v = iter.Current
            list[index] = v
            index = index + 1
        end
    else
        logError("Error,CSharpList is null")
    end
    return list
end