예제 #1
0
        public static YAMLNode ExportYAML(this IEnumerable <int> _this, bool isRaw)
        {
            YAMLSequenceNode node = new YAMLSequenceNode();

            node.Style = isRaw ? SequenceStyle.Raw : SequenceStyle.Block;
            foreach (int value in _this)
            {
                node.Add(value);
            }
            return(node);
        }
예제 #2
0
        public static YAMLNode ExportYAML(this IEnumerable <byte> _this)
        {
            YAMLSequenceNode node = new YAMLSequenceNode();

            node.Style = SequenceStyle.Raw;
            foreach (byte value in _this)
            {
                node.Add(value);
            }
            return(node);
        }
예제 #3
0
        public static YAMLNode ExportYAML(this IEnumerable <IYAMLExportable> _this)
        {
            YAMLSequenceNode node = new YAMLSequenceNode();

            node.Style = SequenceStyle.Block;
            foreach (IYAMLExportable export in _this)
            {
                node.Add(export.ExportYAML());
            }
            return(node);
        }
예제 #4
0
        public static YAMLNode ExportYAML(this IEnumerable <string> _this)
        {
            YAMLSequenceNode node = new YAMLSequenceNode();

            node.Style = SequenceStyle.Block;
            foreach (string value in _this)
            {
                node.Add(value);
            }
            return(node);
        }
예제 #5
0
        public static YAMLNode ExportYAML(this IEnumerable <float> _this)
        {
#warning TODO: check
            //throw new NotImplementedException();
            YAMLSequenceNode node = new YAMLSequenceNode();
            node.Style = SequenceStyle.Block;
            foreach (float value in _this)
            {
                node.Add(value);
            }
            return(node);
        }
예제 #6
0
        public static YAMLNode ExportYAML(this IReadOnlyDictionary <uint, string> _this)
        {
#warning TODO: check
            YAMLSequenceNode node = new YAMLSequenceNode();
            node.Style = SequenceStyle.Block;
            foreach (var kvp in _this)
            {
                YAMLMappingNode map = new YAMLMappingNode();
                map.Add(kvp.Key.ToString(), kvp.Value);
                node.Add(map);
            }
            return(node);
        }
예제 #7
0
        public static YAMLNode ExportYAML(this IReadOnlyDictionary <string, float> _this)
        {
            YAMLSequenceNode node = new YAMLSequenceNode();

            node.Style = SequenceStyle.Block;
            foreach (var kvp in _this)
            {
                YAMLMappingNode map = new YAMLMappingNode();
                map.Add(kvp.Key, kvp.Value);
                node.Add(map);
            }
            return(node);
        }
예제 #8
0
        public static YAMLNode ExportYAML <T>(this IReadOnlyDictionary <T, float> _this)
            where T : IYAMLExportable
        {
            YAMLSequenceNode node = new YAMLSequenceNode();

            node.Style = SequenceStyle.Block;
            foreach (var kvp in _this)
            {
                YAMLMappingNode map = new YAMLMappingNode();
                YAMLNode        key = kvp.Key.ExportYAML();
                if (key.NodeType == YAMLNodeType.Scalar)
                {
                    map.Add(key, kvp.Value);
                }
                else
                {
                    map.Add("first", key);
                    map.Add("second", kvp.Value);
                }
                node.Add(map);
            }
            return(node);
        }