Example #1
0
        private EntityModel parseEntity(YamlMappingNode map)
        {
            if (map.Children.Count != 1)
            {
                throw new YamlException(map.Start, map.End, "Invalid entity structure");
            }

            var node = map.First();

            return(new EntityModel
            {
                Name = node.Key.Val().String(),
                Components = parseObjects(node.Value.Seq())
            });
        }
Example #2
0
 private YamlNode GetChild(string key, YamlMappingNode mapping)
 {
     // NOTE: This line is making a lot of assumptions, we want every one of them to crash, do not add try / catch here
     return(mapping.First(x => ((YamlScalarNode)x.Key).Value.Equals(key, StringComparison.Ordinal)).Value);
 }