Exemple #1
0
        private UIBestiaryEntryInfoPage.BestiaryInfoCategory GetBestiaryInfoCategory(
            IBestiaryInfoElement element)
        {
            switch (element)
            {
            case NPCPortraitInfoElement _:
                return(UIBestiaryEntryInfoPage.BestiaryInfoCategory.Portrait);

            case FlavorTextBestiaryInfoElement _:
                return(UIBestiaryEntryInfoPage.BestiaryInfoCategory.FlavorText);

            case NamePlateInfoElement _:
                return(UIBestiaryEntryInfoPage.BestiaryInfoCategory.Nameplate);

            case ItemFromCatchingNPCBestiaryInfoElement _:
                return(UIBestiaryEntryInfoPage.BestiaryInfoCategory.ItemsFromCatchingNPC);

            case ItemDropBestiaryInfoElement _:
                return(UIBestiaryEntryInfoPage.BestiaryInfoCategory.ItemsFromDrops);

            case NPCStatsReportInfoElement _:
                return(UIBestiaryEntryInfoPage.BestiaryInfoCategory.Stats);

            default:
                return(UIBestiaryEntryInfoPage.BestiaryInfoCategory.Misc);
            }
        }
 private BestiaryInfoCategory GetBestiaryInfoCategory(IBestiaryInfoElement element)
 {
     if (element is NPCPortraitInfoElement)
     {
         return(BestiaryInfoCategory.Portrait);
     }
     if (element is FlavorTextBestiaryInfoElement)
     {
         return(BestiaryInfoCategory.FlavorText);
     }
     if (element is NamePlateInfoElement)
     {
         return(BestiaryInfoCategory.Nameplate);
     }
     if (element is ItemFromCatchingNPCBestiaryInfoElement)
     {
         return(BestiaryInfoCategory.ItemsFromCatchingNPC);
     }
     if (element is ItemDropBestiaryInfoElement)
     {
         return(BestiaryInfoCategory.ItemsFromDrops);
     }
     if (element is NPCStatsReportInfoElement)
     {
         return(BestiaryInfoCategory.Stats);
     }
     return(BestiaryInfoCategory.Misc);
 }
        private int?TryGettingDisplayIndex(BestiaryEntry entry)
        {
            int?nullable = new int?();
            IBestiaryInfoElement bestiaryInfoElement = entry.Info.FirstOrDefault <IBestiaryInfoElement>((Func <IBestiaryInfoElement, bool>)(x => x is IBestiaryEntryDisplayIndex));

            if (bestiaryInfoElement != null)
            {
                nullable = new int?((bestiaryInfoElement as IBestiaryEntryDisplayIndex).BestiaryDisplayIndex);
            }
            return(nullable);
        }
Exemple #4
0
        private int?TryGettingDisplayIndex(BestiaryEntry entry)
        {
            int?result = null;
            IBestiaryInfoElement bestiaryInfoElement = entry.Info.FirstOrDefault((IBestiaryInfoElement x) => x is IBestiaryEntryDisplayIndex);

            if (bestiaryInfoElement != null)
            {
                result = (bestiaryInfoElement as IBestiaryEntryDisplayIndex).BestiaryDisplayIndex;
            }
            return(result);
        }
Exemple #5
0
            private bool IsAStatsCardINeed(IBestiaryInfoElement element, int gameMode)
            {
                NPCStatsReportInfoElement nPCStatsReportInfoElement = element as NPCStatsReportInfoElement;

                if (nPCStatsReportInfoElement == null)
                {
                    return(false);
                }
                if (nPCStatsReportInfoElement.GameMode != gameMode)
                {
                    return(false);
                }
                return(true);
            }
Exemple #6
0
 private bool IsAStatsCardINeed(IBestiaryInfoElement element, int gameMode)
 {
     return(element is NPCStatsReportInfoElement reportInfoElement && reportInfoElement.GameMode == gameMode);
 }
Exemple #7
0
 public ByInfoElement(IBestiaryInfoElement element)
 {
     this._element = element;
 }
Exemple #8
0
 private float GetSortingValueForElement(IBestiaryInfoElement element)
 {
     return(element is IBestiaryBackgroundOverlayAndColorProvider andColorProvider ? andColorProvider.DisplayPriority : 0.0f);
 }
 private float GetSortingValueForElement(IBestiaryInfoElement element)
 {
     return((element as IBestiaryBackgroundOverlayAndColorProvider)?.DisplayPriority ?? 0f);
 }