Ejemplo n.º 1
0
        private object BaseTypeToData(VLTBaseType baseType)
        {
            // if we have a primitive or string value, return that
            // if we have an array, return a list where each item in the array has been converted (recursion FTW)
            // otherwise, just return the original data

            return(baseType switch
            {
                PrimitiveTypeBase ptb => ptb.GetValue(),
                IStringValue sv => sv.GetString(),
                VLTArrayType array => array.Items.Select(BaseTypeToData).ToList(),
                _ => baseType
            });