예제 #1
0
        public void GetSkillInTraining()
        {
            ResponseCache.Clear();
            SkillQueue skillqueue = EveApi.GetSkillQueue(456456, 456436, "asdf");

            SkillQueue.Skill skill0 = skillqueue.SkillList[0];
            SkillQueue.Skill skill1 = skillqueue.SkillList[1];

            //Attributes of the first skill in the queue
            Assert.AreEqual(1, skill0.QueuePosition);
            Assert.AreEqual(11441, skill0.TrainingTypeId);
            Assert.AreEqual(3, skill0.TrainingToLevel);
            Assert.AreEqual(7072, skill0.TrainingStartSP);
            Assert.AreEqual(40000, skill0.TrainingEndSP);
            Assert.AreEqual(new DateTime(2009, 03, 18, 02, 01, 06), skill0.TrainingStartTime);
            Assert.AreEqual(new DateTime(2009, 03, 18, 15, 19, 21), skill0.TrainingEndTime);
            Assert.AreEqual(new DateTime(2009, 03, 17, 21, 01, 06), skill0.TrainingStartTimeLocal);
            Assert.AreEqual(new DateTime(2009, 03, 18, 10, 19, 21), skill0.TrainingEndTimeLocal);

            //Attributes of the second skill in the queue
            Assert.AreEqual(2, skill1.QueuePosition);
            Assert.AreEqual(20533, skill1.TrainingTypeId);
            Assert.AreEqual(4, skill1.TrainingToLevel);
            Assert.AreEqual(112000, skill1.TrainingStartSP);
            Assert.AreEqual(633542, skill1.TrainingEndSP);
            Assert.AreEqual(new DateTime(2009, 03, 18, 15, 19, 21), skill1.TrainingStartTime);
            Assert.AreEqual(new DateTime(2009, 03, 30, 03, 16, 14), skill1.TrainingEndTime);
            Assert.AreEqual(new DateTime(2009, 03, 18, 10, 19, 21), skill1.TrainingStartTimeLocal);
            Assert.AreEqual(new DateTime(2009, 03, 29, 22, 16, 14), skill1.TrainingEndTimeLocal);
        }
        public SkillQueue Parse(XmlDocument xmlDocument)
        {
            this.CheckVersion(xmlDocument);
            SkillQueue skillqueue = new SkillQueue();

            skillqueue.ParseCommonElements(xmlDocument);
            List <SkillQueue.Skill> skills = new List <SkillQueue.Skill>();

            SkillQueue.Skill skill;

            XmlNodeList nodelist = xmlDocument.SelectNodes("//rowset[@name='skillqueue']/row");

            foreach (XmlNode node in nodelist)
            {
                skill = new SkillQueue.Skill(
                    Convert.ToInt32(node.Attributes["queuePosition"].InnerText),
                    Convert.ToInt32(node.Attributes["typeID"].InnerText),
                    Convert.ToInt32(node.Attributes["level"].InnerText),
                    Convert.ToInt32(node.Attributes["startSP"].InnerText),
                    Convert.ToInt32(node.Attributes["endSP"].InnerText),
                    Convert.ToDateTime(node.Attributes["startTime"].InnerText),
                    Convert.ToDateTime(node.Attributes["endTime"].InnerText),
                    TimeUtilities.ConvertCCPToLocalTime(Convert.ToDateTime(node.Attributes["startTime"].InnerText)),
                    TimeUtilities.ConvertCCPToLocalTime(Convert.ToDateTime(node.Attributes["endTime"].InnerText)));
                skills.Add(skill);

                /*
                 * skillqueue.Add(Convert.ToInt32(node.Attributes["queuePosition"].InnerText),
                 *  Convert.ToInt32(node.Attributes["typeID"].InnerText),
                 *  Convert.ToInt32(node.Attributes["level"].InnerText),
                 *  Convert.ToInt32(node.Attributes["startSP"].InnerText),
                 *  Convert.ToInt32(node.Attributes["endSP"].InnerText),
                 *  Convert.ToDateTime(node.Attributes["startTime"].InnerText),
                 *  Convert.ToDateTime(node.Attributes["endTime"].InnerText));
                 */
            }
            skillqueue.SkillList = skills.ToArray();
            return(skillqueue);
        }