Example #1
0
        public static void GetTownHallInfomation(int iIndex)
        {//xem nhu da o trong trang townhall
            //total gold and total gold per hour
            HtmlNode node1 = Gloval.Database.DocumentNode.SelectSingleNode(
                XPathManager.XPathCity.PopulationLimit);

            Gloval.Database.Account.Cities[iIndex].PopulationLimit = NodeParser.toLong(node1.InnerText);

            //----------------
            HtmlNode node2 = Gloval.Database.DocumentNode.SelectSingleNode(
                XPathManager.XPathCity.PopulationGrow);

            Gloval.Database.Account.Cities[iIndex].PopulationGrow = float.Parse(node2.InnerText.Split(' ')[0]);

            //net gold
            HtmlNode node3 = Gloval.Database.DocumentNode.SelectSingleNode(
                XPathManager.XPathCity.NetGold);

            Gloval.Database.Account.Cities[iIndex].GoldPerHour = NodeParser.toUnsignedLong(node3.InnerText);

            //scientist point per hour
            HtmlNode node4 = Gloval.Database.DocumentNode.SelectSingleNode(
                XPathManager.XPathCity.ScientistPointPerHour);

            Gloval.Database.Account.Cities[iIndex].ResearchPointPerHour = NodeParser.toInt(node4.NextSibling.InnerText);
        }
Example #2
0
        public static DTOResearch GetCurrentResearchScientists()
        {//xem nhu chuyen trang roi`
            ////ul[@class='researchLeftMenu']
            if (Gloval.Database.Account.Research == null)
            {
                Gloval.Database.Account.Research = new DTOResearch();
            }

            HtmlNode node = Gloval.Database.DocumentNode.SelectSingleNode(XPathManager.XPathResearch.ResearchPoint);

            Gloval.Database.Account.Research.Scientists            = NodeParser.toInt(node.ChildNodes[1].InnerText);
            Gloval.Database.Account.Research.ResearchPoints        = NodeParser.toLong(node.ChildNodes[3].InnerText);
            Gloval.Database.Account.Research.ResearchPointsPerHour = NodeParser.toInt(node.ChildNodes[5].InnerText);

            return(Gloval.Database.Account.Research);
        }
Example #3
0
        public static DTOResearch GetResearchInformation()
        {//xem nhu chuyen trang roi`
            DTOResearch rs = new DTOResearch();

            //scientist point
            HtmlNode node = Gloval.Database.DocumentNode.SelectSingleNode(XPathManager.XPathResearch.ResearchPoint);

            rs.Scientists            = NodeParser.toInt(node.ChildNodes[1].InnerText);
            rs.ResearchPoints        = NodeParser.toLong(node.ChildNodes[3].InnerText);
            rs.ResearchPointsPerHour = NodeParser.toInt(node.ChildNodes[5].InnerText);

            //4 branch
            HtmlNodeCollection noderesearchinfoCol = Gloval.Database.DocumentNode.SelectNodes(XPathManager.XPathResearch.ResearchEntry);

            rs.Seafaring    = GetInfoResearchBranch(noderesearchinfoCol[0]);
            rs.Economic     = GetInfoResearchBranch(noderesearchinfoCol[1]);
            rs.Scientific   = GetInfoResearchBranch(noderesearchinfoCol[2]);
            rs.Militaristic = GetInfoResearchBranch(noderesearchinfoCol[3]);

            return(rs);
        }