Beispiel #1
0
        private void ShowMultipleCardDeckLeaderAbilityEditDialog(object sender, ToolStripItemClickedEventArgs e)
        {
            List <CardDeckLeaderAbility> selectedCardDeckLeaderAbilityList = new List <CardDeckLeaderAbility>();

            for (int i = 0; i < this.cardDeckLeaderAbilitiesDatagridview.SelectedRows.Count; i++)
            {
                CardDeckLeaderAbility cardDeckLeaderAbility = ((ObjectView <CardDeckLeaderAbility>) this.cardDeckLeaderAbilitiesDatagridview.SelectedRows[i].DataBoundItem).Object;
                selectedCardDeckLeaderAbilityList.Add(this.cardDeckLeaderAbilities.List[cardDeckLeaderAbility.Index]);
            }

            CardDeckLeaderAbilityMultiEditForm form = new CardDeckLeaderAbilityMultiEditForm(selectedCardDeckLeaderAbilityList, ref this.cardDeckLeaderAbilities);

            form.ShowDialog();
            this.cardDeckLeaderAbilitiesDatagridview.Refresh();
        }
    private void applyAbilityChangesToCards()
    {
        for (int abilityIndex = 0; abilityIndex < this.deckLeaderAbilities.Length; abilityIndex++)
        {
            bool deckLeaderAbilityHasChanged = (bool)this.deckLeaderAbilities[abilityIndex][1];

            if (!deckLeaderAbilityHasChanged)
            {
                continue;
            }

            DeckLeaderAbility deckLeaderAbility = (DeckLeaderAbility)this.deckLeaderAbilities[abilityIndex][0];

            for (int cardIndex = 0; cardIndex < this.selectedCardDeckLeaderAbilityList.Count; cardIndex++)
            {
                CardDeckLeaderAbility cardDeckLeaderAbility = this.selectedCardDeckLeaderAbilityList[cardIndex];
                this.allCardDeckLeaderAbilities.List[cardDeckLeaderAbility.Index].deckLeaderAbilityList[abilityIndex] = deckLeaderAbility;
            }
        }
    }