示例#1
0
        private void EnableOrDisableCheckBoxes(List <Follower.Abilities> abilities)
        {
            if (abilities.Count == 2)
            {
                foreach (AbilityCheckBox checkBox in this.abilityCheckBoxPanel.Children)
                {
                    if (!checkBox.IsChecked)
                    {
                        checkBox.IsDisPlayed = false;
                    }
                }
            }
            else
            {
                foreach (AbilityCheckBox checkBox in this.abilityCheckBoxPanel.Children)
                {
                    checkBox.IsDisPlayed = true;
                }
            }

            this.currentClasses = new List <Follower.Classes>();
            if (abilities.Count > 0)
            {
                string classString = string.Empty;
                for (int j = 0; j < 34; j++)
                {
                    List <Follower.Abilities> classAbilities = Follower.GetAbilityFromClass((Follower.Classes)j);
                    bool isContain = true;
                    foreach (Follower.Abilities ability in abilities)
                    {
                        if (!classAbilities.Contains(ability))
                        {
                            isContain = false;
                            break;
                        }
                        else
                        {
                            classAbilities.Remove(ability);
                        }
                    }

                    if (isContain)
                    {
                        this.currentClasses.Add((Follower.Classes)j);
                        classString += Follower.GetCNStringByClass((Follower.Classes)j) + "  ";
                    }
                }
                this.classString.Text = classString;
            }
            else
            {
                this.classString.Text = "选择任意一个或者两个技能组合,查看可拥有此组合的职业天赋。";
            }
        }
示例#2
0
        /// <summary>
        /// For those who have ability that does not belong its class
        /// </summary>
        /// <param name="follower"></param>
        /// <param name="ability1"></param>
        /// <param name="ability2"></param>
        /// <returns></returns>
        private bool IsContainAbility(Follower follower, Follower.Abilities ability1, Follower.Abilities ability2)
        {
            List <Follower.Abilities> list = Follower.GetAbilityFromClass(follower.Class);

            if (!follower.AbilityCollection.Contains(ability1))
            {
                return(false);
            }
            else
            {
                if (ability2 == Follower.Abilities.Error)
                {
                    return(true);
                }
                else
                {
                    return(list.Contains(ability2));
                }
            }
        }
示例#3
0
        public void SetFollower(Follower follower)
        {
            this.Clear();

            this.textName.Text = follower.Name;
            if (follower.Quolaty == 4)
            {
                this.textName.Foreground = Brushes.BlueViolet;
            }
            else if (follower.Quolaty == 3)
            {
                this.textName.Foreground = Brushes.DodgerBlue;
            }
            else if (follower.Quolaty == 2)
            {
                this.textName.Foreground = Brushes.Lime;
            }

            this.textRace.Text      = follower.Race.ToString();
            this.textClass.Text     = Follower.GetCNStringByClass(follower.Class);
            this.textLevel.Text     = follower.Level.ToString();
            this.textItemLevel.Text = follower.ItemLevel.ToString();
            if (follower.ItemLevel >= 645)
            {
                this.textItemLevel.Foreground = Brushes.BlueViolet;
            }
            else if (follower.ItemLevel >= 630)
            {
                this.textItemLevel.Foreground = Brushes.DodgerBlue;
            }
            else if (follower.ItemLevel >= 600)
            {
                this.textItemLevel.Foreground = Brushes.Lime;
            }
            if (!follower.IsActive)
            {
                this.textIsFrozen.Text = "已冻结";
            }

            int i = 0;

            foreach (Follower.Abilities ability in follower.AbilityCollection)
            {
                (this.abilities.Children[i] as Image).Source = Follower.GetImageFromAbility(ability);
                i++;
            }
            i = 0;
            foreach (Follower.Traits trait in follower.TraitCollection)
            {
                (this.traits.Children[i] as Image).Source = Follower.GetImageFromFromTrait(trait);
                i++;
            }
            if (follower.Quolaty < 4)
            {
                List <Follower.Abilities> ablities = Follower.GetAbilityFromClass(follower.Class);
                ablities.Remove(follower.AbilityCollection[0]);
                for (int j = 0; j < 4; j++)
                {
                    (this.possibleAblities.Children[j] as Image).Source = Follower.GetImageFromAbility(ablities[j]);
                }
            }
        }
示例#4
0
        private void AddFollowersToScrollByQuolaty(List <Follower.Abilities> abilities, int quolaty)
        {
            if (abilities.Count == 1)
            {
                foreach (Follower follower in this.allFollowers)
                {
                    if (follower.Quolaty != quolaty)
                    {
                        continue;
                    }

                    if (follower.AbilityCollection.Contains(abilities[0]))
                    {
                        this.AddFollowerForMyScroll(follower, this.favorites.Contains(follower));
                    }
                }
            }
            else
            {
                foreach (Follower follower in this.allFollowers)
                {
                    if (follower.Quolaty != quolaty)
                    {
                        continue;
                    }
                    List <Follower.Abilities> abilityCollection = new List <Follower.Abilities>();
                    abilityCollection.AddRange(follower.AbilityCollection);
                    if (abilityCollection.Contains(abilities[0]))
                    {
                        abilityCollection.Remove(abilities[0]);
                        if (abilityCollection.Contains(abilities[1]))
                        {
                            this.AddFollowerForMyScroll(follower, this.favorites.Contains(follower));
                        }
                    }
                }
                // add possible followers
                if (quolaty != 4)
                {
                    foreach (Follower follower in this.allFollowers)
                    {
                        if (follower.Quolaty != quolaty)
                        {
                            continue;
                        }
                        if (follower.AbilityCollection.Contains(abilities[0]) || follower.AbilityCollection.Contains(abilities[1]))
                        {
                            Follower.Abilities        theOtherAbility  = follower.AbilityCollection.Contains(abilities[0]) ? abilities[1] : abilities[0];
                            List <Follower.Abilities> possibleAbilites = Follower.GetAbilityFromClass(follower.Class);
                            if (possibleAbilites.Contains(follower.AbilityCollection[0]))
                            {
                                possibleAbilites.Remove(follower.AbilityCollection[0]);
                            }
                            if (possibleAbilites.Contains(theOtherAbility))
                            {
                                this.AddFollowerForMyScroll(follower, this.favorites.Contains(follower));
                            }
                        }
                    }
                }
            }
        }
示例#5
0
        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Follower.Classes currentClass = Follower.GetClassBySingleStr(this.classComboBox.SelectedItem.ToString());
            int followerColor             = 0;

            this.aliPanel.Children.Clear();

            foreach (Follower follower in this.listAli.FindAll(x => x.Class == currentClass))
            {
                followerColor = 0;
                if (this.followers.Exists(x => (x.Name == follower.NameCN) || (x.Name == follower.NameEN) || (x.Name == follower.NameTCN)))
                {
                    followerColor = this.followers.First(x => (x.Name == follower.NameCN) || (x.Name == follower.NameEN) || (x.Name == follower.NameTCN)).Quolaty;
                }
                this.aliPanel.Children.Add(new followerFromDatabasexaml(follower, followerColor));
            }

            this.hrdPanel.Children.Clear();
            foreach (Follower follower in this.listHrd.FindAll(x => x.Class == currentClass))
            {
                followerColor = 0;
                if (this.followers.Exists(x => (x.Name == follower.NameCN) || (x.Name == follower.NameEN) || (x.Name == follower.NameTCN)))
                {
                    followerColor = this.followers.First(x => (x.Name == follower.NameCN) || (x.Name == follower.NameEN) || (x.Name == follower.NameTCN)).Quolaty;
                }
                this.hrdPanel.Children.Add(new followerFromDatabasexaml(follower, followerColor));
            }

            foreach (Image image in this.abilityPanel.Children)
            {
                image.Source = null;
            }
            for (int i = 0; i < 5; i++)
            {
                (this.abilityPanel.Children[i] as Image).Source = Follower.GetImageFromAbility(Follower.GetAbilityFromClass(currentClass)[i]);
            }
        }