title: Iterating through a Dictionary of Dictionaries
body: <p>Currently doing a bit of work on parsing a template I made for a small game.</p>
  
  <p>It looks like this:</p>
  
  <pre><code>HEADER:NPC
  NAME:Goblin
  NAMEPLURAL:Goblins
  NAMECHILD:Gob'in
  NAMECHILDPLURAL:Gob'ins
  MOVEMENT0:WALK
  MOVEMENT1:RUN
  MOVEMENT2:SWIM
  BASEHP:30
  BASEMANA:0
  BASELEVEL:1?9
  </code></pre>
  
  <p>In my parser I do the following:</p>
  
  <pre><code>class TemplateParser
  {
      public String folder { get; set; }
  
      public TemplateParser(String folder)
      {
          this.folder = folder;
      }
  
      public Dictionary&lt;String, Dictionary&lt;String, String&gt;&gt; Parse()
      {
          Dictionary&lt;String, Dictionary&lt;String, String&gt;&gt; parsedTemplates =
              new Dictionary&lt;String, Dictionary&lt;String, String&gt;&gt;();
  
          String[] files = Directory.GetFiles(folder);
          StreamReader reader;
  
          foreach (String s in files)
          {
              try
              {
                  String line = "";
                  reader = new StreamReader(s);
                  Dictionary&lt;String, String&gt; attributes = new Dictionary&lt;String, String&gt;();
                  while((line = reader.ReadLine()) != null)
                  {
                      string[] split = line.Split(':');
                      attributes.Add(split[0], split[1]);
                  }
                  parsedTemplates.Add(Path.GetFileNameWithoutExtension(s), attributes);
                  reader.Close();
              }
              catch (IOException ioe)
              {
                  Log.LogMessage(ioe.Message, ELogFlag.CRITICAL);
              }
          }
  
          return parsedTemplates;
      }
  }
  </code></pre>
  
  <p>Now here is the issue:</p>
  
  <p>When I try to look through this collection (after running <code>Parse()</code>) I want to do a little test and write out the dictionary containing all the info from the "Goblin" Dictionary.</p>
  
  <p>So far all my attempts have been futile as when I do <code>templates["Goblin"]</code> I would expect I get a dictionary I could iterate over with <code>foreach()</code> but it wouldn't let me do that. It said something about the conversion not being possible. Then I look for an Enumerator instead but I couldn't get an enumerator to iterate over either.</p>
  
  <p>What am I missing?</p>