Ejemplo n.º 1
1
        public static Quest Load(KmlNode Node)
        {
            Quest quest = new Quest();

            quest.Index = Node.SelectSingleNode("index").Values[1].ValueAsInt;
            quest.Stage = Node.SelectSingleNode("index").Values[2].ValueAsInt;

            if(Node.ChildNodes.ContainsKey("linked"))
            {
                int linkedValue = Node.SelectSingleNode("linked").Values[1].ValueAsInt;

                if (linkedValue == 1)
                {
                    quest.Linked = true;
                }
                else
                {
                    quest.Linked = false;
                }
            }

            quest.Cases = new List<Case>();
            //load cases
            foreach (KmlNode caseNode in Node.SelectNodes("case"))
            {
                quest.Cases.Add(LoadCase(caseNode));
            }

            return quest;
        }
Ejemplo n.º 2
0
        public static Quest Load(KmlNode Node)
        {
            Quest quest = new Quest();

            quest.Index = Node.SelectSingleNode("index").Values[1].ValueAsInt;
            quest.Stage = Node.SelectSingleNode("index").Values[2].ValueAsInt;

            if (Node.ChildNodes.ContainsKey("linked"))
            {
                int linkedValue = Node.SelectSingleNode("linked").Values[1].ValueAsInt;

                if (linkedValue == 1)
                {
                    quest.Linked = true;
                }
                else
                {
                    quest.Linked = false;
                }
            }

            quest.Cases = new List <Case>();
            //load cases
            foreach (KmlNode caseNode in Node.SelectNodes("case"))
            {
                quest.Cases.Add(LoadCase(caseNode));
            }


            return(quest);
        }
Ejemplo n.º 3
0
        public static Map Load(KmlNode Node)
        {
            Map map = new Map();

            map.Index = Node.SelectSingleNode("index").Values[1].ValueAsInt;
            map.Kind = Node.SelectSingleNode("kind").Values[1].ValueAsInt;
            map.Location.X = Node.SelectSingleNode("xy").Values[1].ValueAsInt;
            map.Location.Y = Node.SelectSingleNode("xy").Values[2].ValueAsInt;
            map.FileName = Node.SelectSingleNode("filename").Values[1].Value;

            return map;
        }
Ejemplo n.º 4
0
        public static Map Load(KmlNode Node)
        {
            Map map = new Map();

            map.Index      = Node.SelectSingleNode("index").Values[1].ValueAsInt;
            map.Kind       = Node.SelectSingleNode("kind").Values[1].ValueAsInt;
            map.Location.X = Node.SelectSingleNode("xy").Values[1].ValueAsInt;
            map.Location.Y = Node.SelectSingleNode("xy").Values[2].ValueAsInt;
            map.FileName   = Node.SelectSingleNode("filename").Values[1].Value;

            return(map);
        }
Ejemplo n.º 5
0
        public static GenNpc Load(KmlNode Node)
        {
            GenNpc genNpc = new GenNpc();

            genNpc.Index = Node.SelectSingleNode("index").Values[1].ValueAsInt;

            return genNpc;
        }
Ejemplo n.º 6
0
        public static GenNpc Load(KmlNode Node)
        {
            GenNpc genNpc = new GenNpc();

            genNpc.Index = Node.SelectSingleNode("index").Values[1].ValueAsInt;


            return(genNpc);
        }
Ejemplo n.º 7
0
        public static GenMonster Load(KmlNode Node)
        {
            GenMonster genMonster = new GenMonster();

            genMonster.Index = Node.SelectSingleNode("index").Values[1].ValueAsInt;
            genMonster.Cycle = Node.SelectSingleNode("cycle").Values[1].ValueAsInt;
            genMonster.Area = Node.SelectSingleNode("area").Values[1].ValueAsInt;
            genMonster.Map = Node.SelectSingleNode("map").Values[1].ValueAsInt;
            genMonster.Max = Node.SelectSingleNode("max").Values[1].ValueAsInt;

            //rect
            int X1 = Node.SelectSingleNode("rect").Values[1].ValueAsInt;
            int Y1 = Node.SelectSingleNode("rect").Values[2].ValueAsInt;
            int X2 = Node.SelectSingleNode("rect").Values[3].ValueAsInt;
            int Y2 = Node.SelectSingleNode("rect").Values[4].ValueAsInt;
            genMonster.Rect = new GenMonsterRect(X1,Y1,X2,Y2);

            genMonster.Max = Node.SelectSingleNode("max").Values[1].ValueAsInt;

            return genMonster;
        }
Ejemplo n.º 8
0
        public static GenMonster Load(KmlNode Node)
        {
            GenMonster genMonster = new GenMonster();

            genMonster.Index = Node.SelectSingleNode("index").Values[1].ValueAsInt;
            genMonster.Cycle = Node.SelectSingleNode("cycle").Values[1].ValueAsInt;
            genMonster.Area  = Node.SelectSingleNode("area").Values[1].ValueAsInt;
            genMonster.Map   = Node.SelectSingleNode("map").Values[1].ValueAsInt;
            genMonster.Max   = Node.SelectSingleNode("max").Values[1].ValueAsInt;

            //rect
            int X1 = Node.SelectSingleNode("rect").Values[1].ValueAsInt;
            int Y1 = Node.SelectSingleNode("rect").Values[2].ValueAsInt;
            int X2 = Node.SelectSingleNode("rect").Values[3].ValueAsInt;
            int Y2 = Node.SelectSingleNode("rect").Values[4].ValueAsInt;

            genMonster.Rect = new GenMonsterRect(X1, Y1, X2, Y2);

            genMonster.Max = Node.SelectSingleNode("max").Values[1].ValueAsInt;

            return(genMonster);
        }
Ejemplo n.º 9
0
        public static Case LoadCase(KmlNode CaseNode)
        {
            Case newCase = new Case();
            newCase.Actions = new List<Quests.Action>();
            newCase.Conditions = new List<Condition>();
            //load conditions
            //KmlNode conditions = CaseNode.SelectSingleNode("if");
            //foreach (KmlNode conditionNode in conditions.ChildNodes)
            //{
            //    newCase.Conditions.Add(LoadCondition(conditionNode));
            //}

            //load actions
            KmlNode actions = CaseNode.SelectSingleNode("then");
            foreach (KmlNode actionNode in actions.ChildNodes)
            {
                newCase.Actions.Add(LoadAction(actionNode));
            }

            return newCase;
        }
Ejemplo n.º 10
0
        public static Case LoadCase(KmlNode CaseNode)
        {
            Case newCase = new Case();

            newCase.Actions    = new List <Quests.Action>();
            newCase.Conditions = new List <Condition>();
            //load conditions
            //KmlNode conditions = CaseNode.SelectSingleNode("if");
            //foreach (KmlNode conditionNode in conditions.ChildNodes)
            //{
            //    newCase.Conditions.Add(LoadCondition(conditionNode));
            //}

            //load actions
            KmlNode actions = CaseNode.SelectSingleNode("then");

            foreach (KmlNode actionNode in actions.ChildNodes)
            {
                newCase.Actions.Add(LoadAction(actionNode));
            }

            return(newCase);
        }