Esempio n. 1
0
        private void _FillOutDataToSet(Set set)
        {
            set.Name = SetName_text.Text;
            set.SetSetType((Set.SetType)SetType_chooser.SelectedIndex);
            //set.Block = (Set.SetBlock)SetBlock_listbox.SelectedItem;

            set.RemoveAllCards();
            foreach(Card c in SetCards_listBox.Items)
            {
                set.AddCard(c.Id);
            }
        }
Esempio n. 2
0
        public void Parse(List<Set> outList)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(mFilename);

            XmlNodeList nodes = doc.SelectNodes(ROOT_NODE);

            foreach (XmlNode node in nodes)
            {
                Set set = new Set();

                foreach (XmlNode n in node.ChildNodes)
                {
                    switch (n.Name)
                    {
                        case P_NAME:
                            {
                                set.Name = n.InnerText;
                                break;
                            }
                        case P_TYPE:
                            {
                                set.SetSetType(ParseEnum<Set.SetType>(n.InnerText));
                                break;
                            }
                        case P_ID:
                            {

                                break;
                            }
                        case P_CARDS:
                            {
                                foreach(XmlNode card in n.ChildNodes)
                                {
                                    set.AddCard(Convert.ToUInt32(card.InnerText));
                                }
                                break;
                            }
                        default:
                            {
                                Console.WriteLine("Unhandled node type: " + n.Name);
                                break;
                            }
                    }
                }

                outList.Add(set);
            }
        }