private void button6_Click(object sender, EventArgs e) //deff vill button { var acc = GetSelectedAcc(); var vill = GetSelectedVillage(); DefaultConfigurations.DeffVillagePlan(acc, vill); BuildingHelper.RemoveCompletedTasks(vill, acc); UpdateUc(); }
private void button20_Click(object sender, EventArgs e) //support vill button { var acc = getSelectedAcc(); var vill = getSelectedVillage(); DefaultConfigurations.SupplyVillagePlan(acc, vill); BuildingHelper.RemoveCompletedTasks(vill, acc); UpdateBuildTab(); }
private void button4_Click(object sender, EventArgs e) //all villages off tasks { var acc = getSelectedAcc(); foreach (var vill in acc.Villages) { DefaultConfigurations.OffVillagePlan(acc, vill); BuildingHelper.RemoveCompletedTasks(vill, acc); } }
private void button5_Click(object sender, EventArgs e) //all villages select from file { var acc = getSelectedAcc(); string location = IoHelperForms.PromptUserForBuidTasksLocation(); List <BuildingTask> tasks; using (StreamReader sr = new StreamReader(location)) { tasks = JsonConvert.DeserializeObject <List <BuildingTask> >(sr.ReadToEnd()); } foreach (var vill in acc.Villages) { foreach (var task in tasks) { BuildingHelper.AddBuildingTask(acc, vill, task); } BuildingHelper.RemoveCompletedTasks(vill, acc); } }