Example #1
0
        internal static ItemHoverViewModel Create(Item item)
        {
            Gear   gear = item as Gear;
            Rarity?r    = null;

            if (gear != null)
            {
                r = gear.Rarity;
            }

            Map map = item as Map;

            if (map != null)
            {
                r = map.Rarity;
            }

            Leaguestone stone = item as Leaguestone;

            if (stone != null)
            {
                r = stone.Rarity;
            }

            var vessel = item as DivineVessel;

            if (vessel != null)
            {
                r = Rarity.Normal;
            }

            var offering = item as Offering;

            if (offering != null)
            {
                r = Rarity.Normal;
            }

            var abyssJewel = item as AbyssJewel;

            if (abyssJewel != null)
            {
                r = abyssJewel.Rarity;
            }

            var fullBestiaryOrb = item as FullBestiaryOrb;

            if (fullBestiaryOrb != null)
            {
                r = fullBestiaryOrb.Rarity;
            }

            var questItem = item as QuestItem;

            if (questItem != null)
            {
                return(new QuestItemHoverViewModel(item));
            }

            if (r != null)
            {
                switch (r)
                {
                case Rarity.Relic:
                    return(new RelicGearItemHoverViewModel(item));

                case Rarity.Unique:
                    return(new UniqueGearItemHoverViewModel(item));

                case Rarity.Rare:
                    return(new RareGearItemHoverViewModel(item));

                case Rarity.Magic:
                    return(new MagicGearItemHoverViewModel(item));

                case Rarity.Normal:
                    return(new NormalGearItemHoverViewModel(item));
                }
            }

            if (item is Gem)
            {
                return(new GemItemHoverViewModel(item));
            }

            if (item is Currency || item is Sextant || item is Essence || item is Fossil)
            {
                return(new CurrencyItemHoverViewModel(item));
            }

            if (item is Prophecy)
            {
                return(new ProphecyItemHoverViewModel(item));
            }

            return(new ItemHoverViewModel(item));
        }
Example #2
0
        internal static ItemHoverViewModel Create(Item item)
        {
            Gear   gear = item as Gear;
            Rarity?r    = null;

            if (gear != null)
            {
                r = gear.Rarity;
            }

            Map map = item as Map;

            if (map != null)
            {
                r = map.Rarity;
            }

            Leaguestone stone = item as Leaguestone;

            if (stone != null)
            {
                r = stone.Rarity;
            }

            if (r != null)
            {
                switch (r)
                {
                case Rarity.Relic:
                    return(new RelicGearItemHoverViewModel(item));

                case Rarity.Unique:
                    return(new UniqueGearItemHoverViewModel(item));

                case Rarity.Rare:
                    return(new RareGearItemHoverViewModel(item));

                case Rarity.Magic:
                    return(new MagicGearItemHoverViewModel(item));

                case Rarity.Normal:
                    return(new NormalGearItemHoverViewModel(item));
                }
            }

            if (item is Gem)
            {
                return(new GemItemHoverViewModel(item));
            }

            if (item is Currency)
            {
                return(new CurrencyItemHoverViewModel(item));
            }

            if (item is Prophecy)
            {
                return(new ProphecyItemHoverViewModel(item));
            }

            return(new ItemHoverViewModel(item));
        }