private void cmdFindPool_Click(object sender, EventArgs e) { if (World.Default.Map.Manipulators.AttackManipulator.IsAttackersPoolEmpty) { MessageBox.Show(ControlsRes.AttackPlanCollectionControl_EmptyAttackersPool, ControlsRes.AttackPlanCollectionControl_AttackersPoolTitle); } else if (ActivePlan != null && UnitInput.Unit != null) { VillageType?villageType = GetSelectedVillageTypeFilter(); bool depleted; var searchIn = World.Default.Map.Manipulators.AttackManipulator.GetAttackersFromPool(ActivePlan.Plan, UnitInput.Unit, villageType, out depleted); if (depleted) { MessageBox.Show(ControlsRes.AttackPlanCollectionControl_AttackersPoolDepleted, ControlsRes.AttackPlanCollectionControl_AttackersPoolTitle); } foreach (var attacker in searchIn) { var attackEventArgs = AttackUpdateEventArgs.AddAttackFrom(new AttackPlanFrom(ActivePlan.Plan, attacker.Village, attacker.Speed)); World.Default.Map.EventPublisher.AttackUpdateTarget(this, attackEventArgs); } ActivePlan.SortOnTimeLeft(); } }
private void cmdSort_Click(object sender, EventArgs e) { if (ActivePlan != null) { ActivePlan.SortOnTimeLeft(); } }
private void cmdFind_Click(object sender, EventArgs e) { if (World.Default.You.Empty) { ActivePlayerForm.AskToSetSelf(); } else if (ActivePlan != null) { VillageType?villageType = GetSelectedVillageTypeFilter(); var searchIn = World.Default.Map.Manipulators.AttackManipulator.GetAttackersFromYou(ActivePlan.Plan, UnitInput.Unit, villageType); foreach (var attacker in searchIn) { var attackEventArgs = AttackUpdateEventArgs.AddAttackFrom(new AttackPlanFrom(ActivePlan.Plan, attacker.Village, attacker.Speed)); World.Default.Map.EventPublisher.AttackUpdateTarget(this, attackEventArgs); } ActivePlan.SortOnTimeLeft(); } }