Beispiel #1
0
 public ArticleCategoryInfo GetSpecialArticleCategory(SpecialCategory categoryType)
 {
     //int id = 0;
     //switch (categoryType)
     //{
     //    case SpecialCategory.PageFootService:
     //        id = 1;
     //        break;
     //    case SpecialCategory.PlatformAd:
     //        id = 2;
     //        break;
     //}
     return(GetArticleCategory((int)categoryType));
 }
 int IComparable <LifeCardGameCardInformation> .CompareTo(LifeCardGameCardInformation other)
 {
     if (Category != other.Category)
     {
         return(Category.CompareTo(other.Category));
     }
     if (SpecialCategory != other.SpecialCategory)
     {
         return(SpecialCategory.CompareTo(other.SpecialCategory));
     }
     if (SwitchCategory != other.SwitchCategory)
     {
         return(SwitchCategory.CompareTo(other.SwitchCategory));
     }
     if (Requirement != other.Requirement)
     {
         return(Requirement.CompareTo(other.Requirement));
     }
     return(Points.CompareTo(other.Points));
 }
 public ArticleCategoryInfo GetSpecialArticleCategory(SpecialCategory categoryType)
 {
     return(GetArticleCategory((long)categoryType));
 }
Beispiel #4
0
        private Models.BgmEntryModels.SpecialCategoryEntry GetSpecialCategory(string toneId, SpecialCategory specialCategory, Dictionary <string, string> prefixToneIdMapping)
        {
            if (specialCategory == null)
            {
                return(null);
            }

            if (specialCategory?.Parameters == null)
            {
                _logger.LogWarning("The special category for {ToneId} was disabled. Its configuration was invalid.", toneId);
                return(null);
            }

            switch (specialCategory.Category)
            {
            case SpecialCategories.Persona:
                if (specialCategory.Parameters?.Count != 1 || !Constants.InternalIds.SPECIAL_CATEGORY_PERSONA_VALUES.Contains(specialCategory.Parameters[0]))
                {
                    _logger.LogWarning("The special category for {ToneId} was disabled. Its configuration was invalid.", toneId);
                    return(null);
                }
                return(new Models.BgmEntryModels.SpecialCategoryEntry()
                {
                    Id = new PrcHash40(specialCategory.Parameters[0]).HexValue
                });

            case SpecialCategories.SFPinch:
                if (specialCategory.Parameters.Count == 0)
                {
                    _logger.LogWarning("The special category for {ToneId} was disabled. Its configuration was invalid.", toneId);
                    return(null);
                }
                var pinchSong = specialCategory.Parameters[0].TrimStart(Constants.InternalIds.INFO_ID_PREFIX);
                pinchSong = prefixToneIdMapping.ContainsKey(pinchSong) ? prefixToneIdMapping[pinchSong] : pinchSong;     //Apply potential prefix
                pinchSong = $"{Constants.InternalIds.INFO_ID_PREFIX}{pinchSong}";
                return(new Models.BgmEntryModels.SpecialCategoryEntry()
                {
                    Id = Constants.InternalIds.SPECIAL_CATEGORY_SF_PINCH, Parameters = new List <string>()
                    {
                        pinchSong
                    }
                });
            }

            return(null);
        }