Exemple #1
0
            // Methods
            public CityTreeNode(GCity city, Form1 thisForm)
            {
                this.m_City = city;
                if (this.m_City.CityStatus == 1)
                {
                    base.BackColor = Color.Red;
                    base.ForeColor = Color.Yellow;
                }
                base.Text = city.CityName;
                ContextMenuStrip  strip = new ContextMenuStrip();
                ToolStripMenuItem item  = new ToolStripMenuItem("更新城市(强制)");

                item.Click += new EventHandler(thisForm.ForceUpdateCity_Click);
                strip.Items.Add(item);
                this.ContextMenuStrip = strip;
            }
Exemple #2
0
            // Methods
            public ArmyListViewItem(GArmy army, GCity city)
            {
                this.m_army = army;
                base.Text   = GNations.theNations.GetNation(this.m_army.NationID).NationShortName;
                base.SubItems.Add(this.m_army.PlayerName);
                string text = string.Format("{0}(等级{1})", this.m_army.HeroName, this.m_army.HeroLevel);

                base.SubItems.Add(text);
                base.SubItems.Add(this.m_army.TotalAmount.ToString());
                base.SubItems.Add(this.m_army.Food.ToString());
                base.SubItems.Add(this.GetArmyString(this.m_army.Pos1Id, this.m_army.Pos1Amount));
                base.SubItems.Add(this.GetArmyString(this.m_army.Pos2Id, this.m_army.Pos2Amount));
                base.SubItems.Add(this.GetArmyString(this.m_army.Pos3Id, this.m_army.Pos3Amount));
                base.SubItems.Add(this.GetArmyString(this.m_army.Pos4Id, this.m_army.Pos4Amount));
                base.SubItems.Add(this.GetArmyString(this.m_army.Pos5Id, this.m_army.Pos5Amount));
                if (city.CityNationId != army.NationID)
                {
                    base.BackColor = Color.Red;
                    base.ForeColor = Color.Yellow;
                }
            }
Exemple #3
0
        private void UpdateCityInfo()
        {
            GCity  workCity = this.m_User.WorkCity;
            string str      = string.Format("名称:{0}\r\n内部公告:{1}\r\n面积:{2}\r\n安定:{3}\r\n城防:{4}\r\n交通:{5}\r\n民心:{6}\r\n状态:{7}\r\n\r\n", new object[] { workCity.CityName, workCity.CityBulletin, workCity.CityArea, workCity.CitySafety, workCity.CityDefense, workCity.CityTraffic, workCity.CityMorale, (workCity.CityStatus == 0) ? "正常" : "战争" });

            if (this.m_User.WorkCity.CityStatus == 0)
            {
                str = str + workCity.GetCityArmyInfo();
            }
            else
            {
                str = str + workCity.GetWarArmyInfo();
            }
            this.m_CityInfo.Text = str;
            List <GArmy> armyList = workCity.ArmyList;

            this.m_ArmyList.Items.Clear();
            this.m_bArmySorted = false;
            if (armyList != null)
            {
                foreach (GArmy army in armyList)
                {
                    ArmyListViewItem item = new ArmyListViewItem(army, this.m_User.WorkCity);
                    this.m_ArmyList.Items.Add(item);
                }
            }
            List <GManor> manorList = workCity.ManorList;

            this.m_CityManorList.Items.Clear();
            if (manorList != null)
            {
                foreach (GManor manor in manorList)
                {
                    ListViewItem item2 = new ListViewItem(manor.PlayerName);
                    item2.SubItems.Add(manor.ManorName);
                    item2.SubItems.Add(manor.CreateTime);
                    this.m_CityManorList.Items.Add(item2);
                }
            }
        }