static void Main(string[] args) { var test1 = new VillageItem(); var test = new InitialStrategyDomain(); test.Run(); }
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)); }
public void ReturnItemToTheList ( VillageItem item ) { if (_retriveList.Contains(item)) { itemsList.Add(item); retriveList.Remove(item); } }
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(); } } }
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); } } }
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); } } }