예제 #1
0
        public static List <MoveSet> ReadMoveSets()
        {
            List <MoveSet> returnable = new List <MoveSet>();

            _doc.Load(URL + "movesets.xml");
            XmlElement root = _doc.DocumentElement;
            XmlElement current;

            for (int x = 0; x < root.GetElementsByTagName("MoveSet").Count; x++)
            {
                current = (XmlElement)root.ChildNodes[x];

                int        id      = Convert.ToInt32(current.GetElementsByTagName("Pokemon")[0].InnerText);
                int        version = Convert.ToInt32(current.GetElementsByTagName("VersionGroup")[0].InnerText);
                Move       move    = Database.GetMove(Convert.ToInt32(current.GetElementsByTagName("Move")[0].InnerText));
                MoveMethod method  = Database.GetMoveMethod(Convert.ToInt32(current.GetElementsByTagName("Method")[0].InnerText));
                int        lvl     = Convert.ToInt32(current.GetElementsByTagName("Level")[0].InnerText);
                int        order   = Convert.ToInt32(current.GetElementsByTagName("Index")[0].InnerText);

                MoveSet temp = new MoveSet(id, version, move, method, lvl, order);

                returnable.Add(temp);
            }

            return(returnable);
        }
예제 #2
0
파일: MoveSet.cs 프로젝트: Messorix/PokeDB
 public MoveSet(int p, int v, Move mo, MoveMethod me, int l, int o)
 {
     PokemonID = p;
     Version   = v;
     Move      = mo;
     Method    = me;
     Level     = l;
     Order     = o;
 }
예제 #3
0
        internal static List <MoveMethod> ReadMoveMethods()
        {
            List <MoveMethod> returnable = new List <MoveMethod>();

            _doc.Load(URL + "movemethods.xml");
            XmlElement root = _doc.DocumentElement;
            XmlElement current;

            for (int x = 0; x < root.GetElementsByTagName("MoveMethod").Count; x++)
            {
                current = (XmlElement)root.ChildNodes[x];

                int    id     = Convert.ToInt32(current.GetElementsByTagName("ID")[0].InnerText);
                string method = current.GetElementsByTagName("Method")[0].InnerText;

                MoveMethod temp = new MoveMethod(id, method);

                returnable.Add(temp);
            }

            return(returnable);
        }