Example #1
0
        public static Embed GetGear(this XIVAPICharacter self)
        {
            if (self.GearSet == null || self.GearSet.Gear == null)
            {
                throw new Exception("No gear set on character.");
            }

            EmbedBuilder builder = new EmbedBuilder();

            builder.ImageUrl     = self.Portrait;
            builder.ThumbnailUrl = "https://xivapi.com/" + self.GearSet.Gear.MainHand?.Item?.Icon;
            builder.Title        = self.Name;
            builder.Description  = "Average item level: " + self.GetAverageLevel().ToString();

            builder.AddGear("Main Hand", self.GearSet.Gear.MainHand, false);
            builder.AddGear("Off Hand", self.GearSet.Gear.OffHand, false);
            builder.AddGear("Head", self.GearSet.Gear.Head, true);
            builder.AddGear("Body", self.GearSet.Gear.Body, true);
            builder.AddGear("Hands", self.GearSet.Gear.Hands, true);
            builder.AddGear("Waist", self.GearSet.Gear.Waist, true);
            builder.AddGear("Legs", self.GearSet.Gear.Legs, true);
            builder.AddGear("Feet", self.GearSet.Gear.Feet, true);
            builder.AddGear("Earrings", self.GearSet.Gear.Earrings, true);
            builder.AddGear("Necklace", self.GearSet.Gear.Necklace, true);
            builder.AddGear("Bracelets", self.GearSet.Gear.Bracelets, true);
            builder.AddGear("Ring", self.GearSet.Gear.Ring1, true);
            builder.AddGear("Ring", self.GearSet.Gear.Ring2, true);

            return(builder.Build());
        }