Пример #1
0
        private static IList <Tuple <string, IComparer <Skill> > > GenerateSortList()
        {
            List <Tuple <string, IComparer <Skill> > > ret = new List <Tuple <string, IComparer <Skill> > >()
            {
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortAlphabetical", GlobalOptions.Language),
                                                       new SkillSorter(SkillsSection.CompareSkills)),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortRating", GlobalOptions.Language),
                                                       new SkillSorter((x, y) => y.Rating.CompareTo(x.Rating))),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortDicepool", GlobalOptions.Language),
                                                       new SkillSorter((x, y) => y.Pool.CompareTo(x.Pool))),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortLowerDicepool", GlobalOptions.Language),
                                                       new SkillSorter((x, y) => x.Pool.CompareTo(y.Pool))),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortAttributeValue", GlobalOptions.Language),
                                                       new SkillSorter((x, y) => y.AttributeModifiers.CompareTo(x.AttributeModifiers))),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortAttributeName", GlobalOptions.Language),
                                                       new SkillSorter((x, y) => string.Compare(x.DisplayAttribute, y.DisplayAttribute, StringComparison.Ordinal))),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortGroupName", GlobalOptions.Language),
                                                       new SkillSorter((x, y) => SkillsSection.CompareSkillGroups(x.SkillGroupObject, y.SkillGroupObject))),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortGroupRating", GlobalOptions.Language),
                                                       new SkillSortBySkillGroup()),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortCategory", GlobalOptions.Language),
                                                       new SkillSorter((x, y) => string.Compare(x.DisplayCategory(GlobalOptions.Language), y.DisplayCategory(GlobalOptions.Language), StringComparison.Ordinal))),
            };

            return(ret);
        }
Пример #2
0
        public void AddSkillSteps()
        {
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "LanguagesAndSkills");

            SkillsSection.Click();
            AddNewBtnSkill.Click();
            //AddNewButton.Click();
            EnterSkillField.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Skill"));
            LevelSkillField.Click();
            SelectElement selectLevel = new SelectElement(LevelSkillField);

            selectLevel.SelectByText(GlobalDefinitions.ExcelLib.ReadData(2, "Skill Level"));
            AddSkillsButton.Click();
            GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("//div[contains(@class,'ns-box ns-growl ns-effect-jelly ns-type-success ns-show')]"), 10);
        }
Пример #3
0
    private static void RefreshDatabase()
    {
        DatabaseManager m = new DatabaseManager();

        spawns = new SpawnSection();
        mobs   = new MobsSection();
        items  = new ItemsSection();
        skills = new SkillsSection();

        SpritesManager.Initialize();

        mobs.LoadMobs();
        items.LoadData();
        spawns.LoadMobs();
        skills.LoadMobs();
    }
Пример #4
0
        private static List <Tuple <string, IComparer <KnowledgeSkill> > > GenerateKnowledgeSortList()
        {
            List <Tuple <string, IComparer <KnowledgeSkill> > > ret = new List <Tuple <string, IComparer <KnowledgeSkill> > >(7)
            {
                new Tuple <string, IComparer <KnowledgeSkill> >(LanguageManager.GetString("Skill_SortAlphabetical"),
                                                                new KnowledgeSkillSorter(SkillsSection.CompareSkills)),
                new Tuple <string, IComparer <KnowledgeSkill> >(LanguageManager.GetString("Skill_SortRating"),
                                                                new KnowledgeSkillSorter((x, y) =>
                {
                    int intReturn = y.Rating.CompareTo(x.Rating);
                    if (intReturn == 0)
                    {
                        intReturn = SkillsSection.CompareSkills(x, y);
                    }
                    return(intReturn);
                })),
                new Tuple <string, IComparer <KnowledgeSkill> >(LanguageManager.GetString("Skill_SortDicepool"),
                                                                new KnowledgeSkillSorter((x, y) =>
                {
                    int intReturn = y.Pool.CompareTo(x.Pool);
                    if (intReturn == 0)
                    {
                        intReturn = SkillsSection.CompareSkills(x, y);
                    }
                    return(intReturn);
                })),
                new Tuple <string, IComparer <KnowledgeSkill> >(LanguageManager.GetString("Skill_SortLowerDicepool"),
                                                                new KnowledgeSkillSorter((x, y) =>
                {
                    int intReturn = x.Pool.CompareTo(y.Pool);
                    if (intReturn == 0)
                    {
                        intReturn = SkillsSection.CompareSkills(x, y);
                    }
                    return(intReturn);
                })),
                new Tuple <string, IComparer <KnowledgeSkill> >(LanguageManager.GetString("Skill_SortAttributeValue"),
                                                                new KnowledgeSkillSorter((x, y) =>
                {
                    int intReturn = y.AttributeModifiers.CompareTo(x.AttributeModifiers);
                    if (intReturn == 0)
                    {
                        intReturn = string.Compare(x.DisplayAttribute, y.DisplayAttribute, false, GlobalSettings.CultureInfo);
                        if (intReturn == 0)
                        {
                            intReturn = SkillsSection.CompareSkills(x, y);
                        }
                    }
                    return(intReturn);
                })),
                new Tuple <string, IComparer <KnowledgeSkill> >(LanguageManager.GetString("Skill_SortAttributeName"),
                                                                new KnowledgeSkillSorter((x, y) =>
                {
                    int intReturn = string.Compare(x.DisplayAttribute, y.DisplayAttribute, false, GlobalSettings.CultureInfo);
                    if (intReturn == 0)
                    {
                        intReturn = SkillsSection.CompareSkills(x, y);
                    }
                    return(intReturn);
                })),
                new Tuple <string, IComparer <KnowledgeSkill> >(LanguageManager.GetString("Skill_SortCategory"),
                                                                new KnowledgeSkillSorter((x, y) =>
                {
                    int intReturn = string.Compare(x.CurrentDisplayCategory, y.CurrentDisplayCategory, false, GlobalSettings.CultureInfo);
                    if (intReturn == 0)
                    {
                        intReturn = SkillsSection.CompareSkills(x, y);
                    }
                    return(intReturn);
                }))
            };

            return(ret);
        }
Пример #5
0
        private static List <Tuple <string, IComparer <Skill> > > GenerateSortList()
        {
            List <Tuple <string, IComparer <Skill> > > ret = new List <Tuple <string, IComparer <Skill> > >(9)
            {
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortAlphabetical"),
                                                       new SkillSorter(SkillsSection.CompareSkills)),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortRating"),
                                                       new SkillSorter((x, y) =>
                {
                    int intReturn = y.Rating.CompareTo(x.Rating);
                    if (intReturn == 0)
                    {
                        if (y.Specializations.Count > 0 || x.Specializations.Count > 0)
                        {
                            if (x.Specializations.Count == 0)
                            {
                                return(1);
                            }
                            if (y.Specializations.Count == 0)
                            {
                                return(-1);
                            }
                            if (y.Specializations.Count > x.Specializations.Count)
                            {
                                return(1);
                            }
                            if (y.Specializations.Count < x.Specializations.Count)
                            {
                                return(-1);
                            }
                        }
                        intReturn = SkillsSection.CompareSkills(x, y);
                    }
                    return(intReturn);
                })),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortDicepool"),
                                                       new SkillSorter((x, y) =>
                {
                    int intReturn = y.Pool.CompareTo(x.Pool);
                    if (intReturn == 0)
                    {
                        if (y.Specializations.Count > 0 || x.Specializations.Count > 0)
                        {
                            if (x.Specializations.Count == 0)
                            {
                                return(1);
                            }
                            if (y.Specializations.Count == 0)
                            {
                                return(-1);
                            }
                            int intLeftMax  = x.Specializations.Max(z => z.SpecializationBonus);
                            int intRightMax = y.Specializations.Max(z => z.SpecializationBonus);
                            if (intRightMax > intLeftMax)
                            {
                                return(1);
                            }
                            if (intRightMax < intLeftMax)
                            {
                                return(-1);
                            }
                            if (y.Specializations.Count > x.Specializations.Count)
                            {
                                return(1);
                            }
                            if (y.Specializations.Count < x.Specializations.Count)
                            {
                                return(-1);
                            }
                        }
                        intReturn = SkillsSection.CompareSkills(x, y);
                    }

                    return(intReturn);
                })),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortLowerDicepool"),
                                                       new SkillSorter((x, y) =>
                {
                    int intReturn = x.Pool.CompareTo(y.Pool);
                    if (intReturn == 0)
                    {
                        if (y.Specializations.Count > 0 || x.Specializations.Count > 0)
                        {
                            if (x.Specializations.Count == 0)
                            {
                                return(-1);
                            }
                            if (y.Specializations.Count == 0)
                            {
                                return(1);
                            }
                            int intLeftMax  = x.Specializations.Max(z => z.SpecializationBonus);
                            int intRightMax = y.Specializations.Max(z => z.SpecializationBonus);
                            if (intRightMax > intLeftMax)
                            {
                                return(-1);
                            }
                            if (intRightMax < intLeftMax)
                            {
                                return(1);
                            }
                            if (y.Specializations.Count > x.Specializations.Count)
                            {
                                return(-1);
                            }
                            if (y.Specializations.Count < x.Specializations.Count)
                            {
                                return(1);
                            }
                        }
                        intReturn = SkillsSection.CompareSkills(x, y);
                    }
                    return(intReturn);
                })),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortAttributeValue"),
                                                       new SkillSorter((x, y) =>
                {
                    int intReturn = y.AttributeModifiers.CompareTo(x.AttributeModifiers);
                    if (intReturn == 0)
                    {
                        intReturn = string.Compare(x.DisplayAttribute, y.DisplayAttribute, false, GlobalSettings.CultureInfo);
                        if (intReturn == 0)
                        {
                            intReturn = SkillsSection.CompareSkills(x, y);
                        }
                    }
                    return(intReturn);
                })),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortAttributeName"),
                                                       new SkillSorter((x, y) =>
                {
                    int intReturn = string.Compare(x.DisplayAttribute, y.DisplayAttribute, false, GlobalSettings.CultureInfo);
                    if (intReturn == 0)
                    {
                        intReturn = SkillsSection.CompareSkills(x, y);
                    }
                    return(intReturn);
                })),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortGroupName"),
                                                       new SkillSorter((x, y) =>
                {
                    int intReturn = SkillsSection.CompareSkillGroups(x.SkillGroupObject, y.SkillGroupObject);
                    if (intReturn == 0)
                    {
                        intReturn = SkillsSection.CompareSkills(x, y);
                    }
                    return(intReturn);
                })),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortGroupRating"),
                                                       new SkillSortBySkillGroup()),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortCategory"),
                                                       new SkillSorter((x, y) =>
                {
                    int intReturn = string.Compare(x.CurrentDisplayCategory, y.CurrentDisplayCategory, false, GlobalSettings.CultureInfo);
                    if (intReturn == 0)
                    {
                        intReturn = SkillsSection.CompareSkills(x, y);
                    }
                    return(intReturn);
                }))
            };

            return(ret);
        }
Пример #6
0
        private static List <Tuple <string, IComparer <Skill> > > GenerateSortList()
        {
            List <Tuple <string, IComparer <Skill> > > ret = new List <Tuple <string, IComparer <Skill> > >(9)
            {
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortAlphabetical"),
                                                       new SkillSorter(SkillsSection.CompareSkills)),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortRating"),
                                                       new SkillSorter((x, y) =>
                {
                    int intReturn = y.Rating.CompareTo(x.Rating);
                    if (intReturn == 0)
                    {
                        intReturn = SkillsSection.CompareSkills(x, y);
                    }
                    return(intReturn);
                })),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortDicepool"),
                                                       new SkillSorter((x, y) =>
                {
                    int intReturn = y.Pool.CompareTo(x.Pool);
                    if (intReturn == 0)
                    {
                        intReturn = SkillsSection.CompareSkills(x, y);
                    }
                    return(intReturn);
                })),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortLowerDicepool"),
                                                       new SkillSorter((x, y) =>
                {
                    int intReturn = x.Pool.CompareTo(y.Pool);
                    if (intReturn == 0)
                    {
                        intReturn = SkillsSection.CompareSkills(x, y);
                    }
                    return(intReturn);
                })),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortAttributeValue"),
                                                       new SkillSorter((x, y) =>
                {
                    int intReturn = y.AttributeModifiers.CompareTo(x.AttributeModifiers);
                    if (intReturn == 0)
                    {
                        intReturn = string.Compare(x.DisplayAttribute, y.DisplayAttribute, false, GlobalOptions.CultureInfo);
                        if (intReturn == 0)
                        {
                            intReturn = SkillsSection.CompareSkills(x, y);
                        }
                    }
                    return(intReturn);
                })),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortAttributeName"),
                                                       new SkillSorter((x, y) =>
                {
                    int intReturn = string.Compare(x.DisplayAttribute, y.DisplayAttribute, false, GlobalOptions.CultureInfo);
                    if (intReturn == 0)
                    {
                        intReturn = SkillsSection.CompareSkills(x, y);
                    }
                    return(intReturn);
                })),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortGroupName"),
                                                       new SkillSorter((x, y) =>
                {
                    int intReturn = SkillsSection.CompareSkillGroups(x.SkillGroupObject, y.SkillGroupObject);
                    if (intReturn == 0)
                    {
                        intReturn = SkillsSection.CompareSkills(x, y);
                    }
                    return(intReturn);
                })),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortGroupRating"),
                                                       new SkillSortBySkillGroup()),
                new Tuple <string, IComparer <Skill> >(LanguageManager.GetString("Skill_SortCategory"),
                                                       new SkillSorter((x, y) =>
                {
                    int intReturn = string.Compare(x.DisplayCategory(GlobalOptions.Language), y.DisplayCategory(GlobalOptions.Language), false, GlobalOptions.CultureInfo);
                    if (intReturn == 0)
                    {
                        intReturn = SkillsSection.CompareSkills(x, y);
                    }
                    return(intReturn);
                })),
            };

            return(ret);
        }