Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
        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);
            }
        }