public RankRequirementDeckLeaderAbility(int index, byte[] bytes) : base(index, bytes)
    {
        if (DeckLeaderAbility.RankRequirementLowerByteAbilityList.Contains((DeckLeaderAbilityType)index))
        {
            this.rankRequirementHalfByteLocation = RankRequirementByteLocation.LOWER_BYTE;
        }
        else if (DeckLeaderAbility.RankRequirementUpperByteAbilityList.Contains((DeckLeaderAbilityType)index))
        {
            this.rankRequirementHalfByteLocation = RankRequirementByteLocation.UPPER_BYTE;
        }

        if (!this.Enabled)
        {
            return;
        }

        if (this.rankRequirementHalfByteLocation == RankRequirementByteLocation.LOWER_BYTE)
        {
            this.unlockRank = new DeckLeaderRank(this.Bytes[0]);
        }

        if (this.rankRequirementHalfByteLocation == RankRequirementByteLocation.UPPER_BYTE)
        {
            this.unlockRank = new DeckLeaderRank(this.Bytes[1]);
        }
    }
Exemple #2
0
        private void loadDeckData()
        {
            byte[][][] deckBytes = dataAccess.LoadDecks();
            deckList = Deck.LoadDeckListFromBytes(deckBytes);
            deckListBinding.DataSource = deckList;
            deckDropdown.DataSource    = deckListBinding;

            deckEditDeckLeaderRankComboBox.DataSource    = DeckLeaderRank.RankList();
            deckEditDeckLeaderRankComboBox.SelectedIndex = ((Deck)deckDropdown.SelectedItem).DeckLeader.Rank.Index;

            refreshDeckInfoLabels();
        }
Exemple #3
0
        private void addCardsToDeck(List <DataGridViewRow> rows)
        {
            foreach (DataGridViewRow row in rows)
            {
                CardConstant   cardConstant = ((ObjectView <CardConstant>)row.DataBoundItem).Object;
                DeckLeaderRank rank         = new DeckLeaderRank((int)DeckLeaderRankType.NCO);
                DeckCard       deckCard     = new DeckCard(cardConstant, rank);
                deckCardListBinding.Add(deckCard);
            }

            refreshDeckInfoLabels();
        }
Exemple #4
0
        private void setupForm()
        {
            List <DeckLeaderRank> validRanks = DeckLeaderRank.RankList();

            validRanks.RemoveAt((int)DeckLeaderRankType.NCO);
            this.rankDropdown.DataSource    = validRanks;
            this.rankDropdown.DisplayMember = "Name";
            this.rankDropdown.ValueMember   = "Index";
            this.rankDropdown.DropDownStyle = ComboBoxStyle.DropDownList;

            this.enabledCheckbox.Checked = this.DeckLeaderAbility.Enabled;
            this.toggleDropdownVisibility(this.DeckLeaderAbility.Enabled);

            RankRequirementDeckLeaderAbility rankRequirementDeckLeaderAbility = (RankRequirementDeckLeaderAbility)this.DeckLeaderAbility;
            DeckLeaderRank unlockRank = rankRequirementDeckLeaderAbility.UnlockRank != null ? rankRequirementDeckLeaderAbility.UnlockRank : new DeckLeaderRank((int)DeckLeaderRankType.SECOND_LT);

            this.rankDropdown.SelectedValue = unlockRank.Index;
        }
Exemple #5
0
 public DeckLeaderRankThreshold(byte rankIndex, byte[] byteData)
 {
     this.Bytes = byteData;
     this.Rank  = new DeckLeaderRank(rankIndex);
 }