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); }
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; }
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); }