Example #1
0
        public static void requestTownHall(int iIndexCity)
        {
            if (0 <= iIndexCity && iIndexCity < Gloval.Database.Account.Cities.Count())
            {
                BUSCity.ChangeCityTo(iIndexCity);

                if (Gloval.Database.CurrentView != Data.SITE_VIEW.TOWN_HALL)
                {
                    if (Gloval.Database.CurrentView != Data.SITE_VIEW.CITY)
                    {
                        BUSCity.GoToCity();
                    }

                    BUSCity.GoToTownHall();
                }

                Gloval.Database.Account.Cities[iIndexCity].DTTownHall = DateTime.Now;

                //lấy thông tin
                long  PopulationLimit;
                float PopulationGrow;
                long  GoldPerHour;
                int   ResearchPointPerHour;
                DAOCity.GetTownHallInfomation(iIndexCity,
                                              out PopulationLimit,
                                              out PopulationGrow,
                                              out GoldPerHour,
                                              out ResearchPointPerHour);

                Gloval.Database.Account.Cities[iIndexCity].PopulationLimit      = PopulationLimit;
                Gloval.Database.Account.Cities[iIndexCity].PopulationGrow       = PopulationGrow;
                Gloval.Database.Account.Cities[iIndexCity].GoldPerHour          = GoldPerHour;
                Gloval.Database.Account.Cities[iIndexCity].ResearchPointPerHour = ResearchPointPerHour;
            }
        }
Example #2
0
        //town hall info
        public static void ForceUpdateTownHall(int iIndexCity)
        {
            BUSCity.ChangeCityTo(iIndexCity, true);
            if (Gloval.Database.CurrentView != Data.SITE_VIEW.TOWN_HALL)
            {
                if (Gloval.Database.CurrentView != Data.SITE_VIEW.CITY)
                {
                    DAOCity.GoToCity();
                }

                DAOCity.GoToTownHall();
            }

            Gloval.Database.Account.Cities[iIndexCity].DTTownHall = DateTime.Now;

            //lấy thông tin
            DAOCity.GetTownHallInfomation(iIndexCity);
        }