WinterSync.LuaValue.GetField C# (CSharp) Method

GetField() public method

/// returns value that corresponds to a key from a LuaValue.Table map
public GetField ( string key ) : LuaValue
key string
return LuaValue
        public LuaValue GetField(string key)
        {
            var table = this as LuaTable;
            if (table == null) throw new Exception("value is not table");
            var found = table.Values.FirstOrDefault(kvp => kvp.Key is LuaString && ((LuaString) kvp.Key).Value == key);
            return found.Value;
        }