static void Main(string[] args)
        {
            var test1 = new VillageItem();

            var test = new InitialStrategyDomain();

            test.Run();
        }
Esempio n. 2
0
        public override Gene GenerateGene(int geneIndex)
        {
            var village = new VillageItem();
            var result  = village.getBaseGen();

            // Generate a gene base on my problem chromosome representation.
            return(new Gene(village));
        }
Esempio n. 3
0
 public void ReturnItemToTheList ( VillageItem item )
 {
     if (_retriveList.Contains(item))
     {
         itemsList.Add(item);
         retriveList.Remove(item);
     }
 }
Esempio n. 4
0
 private void listBoxVillages_DoubleClick(object sender, EventArgs e)
 {
     if (this.listBoxVillages.SelectedIndex >= 0)
     {
         VillageItem selectedItem = (VillageItem)this.listBoxVillages.SelectedItem;
         if (selectedItem != null)
         {
             GameEngine.Instance.World.zoomToVillage(selectedItem.villageID);
             base.Close();
         }
     }
 }
Esempio n. 5
0
 private void btnSearchByName_Click(object sender, EventArgs e)
 {
     if (this.tbSearchName.Text.Length > 0)
     {
         List <int> list = GameEngine.Instance.World.searchVillageNames(this.tbSearchName.Text);
         this.listBoxVillages.Items.Clear();
         foreach (int num in list)
         {
             VillageItem item = new VillageItem {
                 villageID = num
             };
             this.listBoxVillages.Items.Add(item);
         }
     }
 }
Esempio n. 6
0
        private void btnSearchByID_Click(object sender, EventArgs e)
        {
            int villageID = getInt32FromString(this.tbVillageID.Text);

            if (villageID >= 0)
            {
                this.listBoxVillages.Items.Clear();
                if ((!GameEngine.Instance.World.isCapital(villageID) && (!GameEngine.Instance.World.isSpecial(villageID) || this.aiWorldSpecial(villageID))) && GameEngine.Instance.World.isVillageVisible(villageID))
                {
                    VillageItem item = new VillageItem {
                        villageID = villageID
                    };
                    this.listBoxVillages.Items.Add(item);
                }
            }
        }