Example #1
0
 public T GetChainedNode <T>(string s) where T : YamlNode
 {
     s = s.Replace(":", ";");
     if (!buffer.ContainsKey(s))
     {
         string[]        steps   = s.Split(new char[] { ';' });
         YamlMappingNode current = YAML.Read(file);
         int             i       = 0;
         try
         {
             for (i = 0; i < steps.Length - 1; i++)
             {
                 current = current.GetNode <YamlMappingNode>(steps[i]);
             }
             buffer.Add(s, current.GetNode <T>(steps[steps.Length - 1]));
         }
         catch (KeyNotFoundException e)
         {
             Debug.Log("failed at " + i + " : " + steps[i] + " of : " + s);
             throw e;
         }
     }
     return(buffer[s] as T);
 }
Example #2
0
 public static YamlMappingNode GetFile(string filename)
 {
     return(YAML.Read(filename));
 }