Beispiel #1
0
        public static int CompareSkills(Skill rhs, Skill lhs)
        {
            ExoticSkill lhsExoticSkill = lhs as ExoticSkill;

            if (rhs is ExoticSkill rhsExoticSkill)
            {
                if (lhsExoticSkill != null)
                {
                    return(string.Compare(rhsExoticSkill.DisplaySpecific(GlobalOptions.Language), lhsExoticSkill.DisplaySpecific(GlobalOptions.Language) ?? string.Empty, StringComparison.Ordinal));
                }
                else
                {
                    return(1);
                }
            }
            else if (lhsExoticSkill != null)
            {
                return(-1);
            }

            return(string.Compare(rhs.DisplayNameMethod(GlobalOptions.Language), lhs.DisplayNameMethod(GlobalOptions.Language), StringComparison.Ordinal));
        }
Beispiel #2
0
        public static int CompareSkills(Skill rhs, Skill lhs)
        {
            ExoticSkill lhsExoticSkill = (lhs.IsExoticSkill ? lhs : null) as ExoticSkill;

            if ((rhs.IsExoticSkill ? rhs : null) is ExoticSkill rhsExoticSkill)
            {
                if (lhsExoticSkill != null)
                {
                    return(string.Compare(rhsExoticSkill.Specific ?? string.Empty, lhsExoticSkill.Specific ?? string.Empty, StringComparison.Ordinal));
                }
                else
                {
                    return(1);
                }
            }
            else if (lhsExoticSkill != null)
            {
                return(-1);
            }

            return(string.Compare(rhs.DisplayName, lhs.DisplayName, StringComparison.Ordinal));
        }
Beispiel #3
0
        private IEnumerable <Improvement> RelevantImprovements(Func <Improvement, bool> funcWherePredicate = null)
        {
            if (!string.IsNullOrWhiteSpace(Name))
            {
                foreach (Improvement objImprovement in CharacterObject.Improvements)
                {
                    if (objImprovement.Enabled && funcWherePredicate?.Invoke(objImprovement) != false)
                    {
                        switch (objImprovement.ImproveType)
                        {
                        case Improvement.ImprovementType.Skill:

                            if (objImprovement.ImprovedName == Name)
                            {
                                yield return(objImprovement);

                                break;
                            }
                            if (IsExoticSkill)
                            {
                                ExoticSkill s = (ExoticSkill)this;
                                if (objImprovement.ImprovedName == $"{Name} ({s.Specific})")
                                {
                                    yield return(objImprovement);
                                }
                            }
                            break;

                        case Improvement.ImprovementType.SkillGroup:
                            if (objImprovement.ImprovedName == _strGroup && !objImprovement.Exclude.Contains(Name) && !objImprovement.Exclude.Contains(SkillCategory))
                            {
                                yield return(objImprovement);
                            }
                            break;

                        case Improvement.ImprovementType.SkillCategory:
                            if (objImprovement.ImprovedName == SkillCategory && !objImprovement.Exclude.Contains(Name))
                            {
                                yield return(objImprovement);
                            }
                            break;

                        case Improvement.ImprovementType.SkillAttribute:
                            if (objImprovement.ImprovedName == AttributeObject.Abbrev && !objImprovement.Exclude.Contains(Name))
                            {
                                yield return(objImprovement);
                            }
                            break;

                        case Improvement.ImprovementType.BlockSkillDefault:
                            if (objImprovement.ImprovedName == SkillGroup)
                            {
                                yield return(objImprovement);
                            }
                            break;

                        case Improvement.ImprovementType.SwapSkillAttribute:
                        case Improvement.ImprovementType.SwapSkillSpecAttribute:
                            if (objImprovement.Target == Name)
                            {
                                yield return(objImprovement);
                            }
                            break;

                        case Improvement.ImprovementType.EnhancedArticulation:
                            if (_strCategory == "Physical Active" && AttributeSection.PhysicalAttributes.Contains(AttributeObject.Abbrev))
                            {
                                yield return(objImprovement);
                            }
                            break;
                        }
                    }
                }
            }
        }