Esempio n. 1
0
 public Part(Character c, string t)
 {
     chr = c;
     text = t;
 }
Esempio n. 2
0
        private static void loadCharacters()
        {
            XElement root;
            if (all.Count () == 0) {
                Console.WriteLine ("Real Load from XML File");
                XDocument xchar = XDocument.Load ("story.xml");
                root = xchar.Root;

                IEnumerable<XElement> char_tag =
                    (from el in root.Elements ("characters")
                    //where (string)el.Attribute("id") == id.ToString()
                    select el);

                List<Character> l = new List<Character> ();
                XElement c = char_tag.First();

                    IEnumerable<XElement> chars =
                        (from el in c.Elements ("char")
                            //where (string)el.Attribute("id") == id.ToString()
                            select el);

                    foreach(XElement ch in chars){

                        Character cha = new Character ((string)ch.Attribute ("id"), (string)ch.Attribute ("face"),(ch.FirstNode as XText).Value);
                        l.Add (cha);
                        //Console.WriteLine (ch);

                }
                all = l;
            }
        }