コード例 #1
0
 private void AppendMiscData(ChampionDto champion, FormattedEmbedBuilder message)
 {
     champion.Tags.Sort();
     message
     .SetThumbnail($"http://ddragon.leagueoflegends.com/cdn/{Property.RiotUrlVersion.Value}/img/champion/{champion.Name}.png")
     .AppendTitle($"{champion.Name} {champion.Title}", AppendOption.Bold, AppendOption.Underscore)
     .AppendDescription("Classified as:", AppendOption.Italic)
     .AppendDescription($" {string.Join(", ", champion.Tags)}")
     .AppendDescriptionNewLine()
     .AppendDescription("Resource:", AppendOption.Italic)
     .AppendDescription($" {champion.Resource}")
     .AppendDescriptionNewLine()
     .AppendDescription("Passive:", AppendOption.Italic)
     .AppendDescription($" {champion.Passive.Name}");
 }
コード例 #2
0
        private async Task AppendData(ItemDto item, FormattedEmbedBuilder message)
        {
            message
            .SetThumbnail($"http://ddragon.leagueoflegends.com/cdn/{Property.RiotUrlVersion.Value}/img/item/{item.Id}.png")
            .AppendTitle(item.Name, AppendOption.Bold, AppendOption.Underscore)
            .AppendDescription(item.SanitizedDescription)
            .AppendDescriptionNewLine(2)
            .AppendDescription($"Total Cost:", AppendOption.Italic).AppendDescription($" {item.Gold.Total} Gold")
            .AppendDescriptionNewLine()
            .AppendDescription($"Selling for:", AppendOption.Italic).AppendDescription($" {item.Gold.Sell} Gold")
            .AppendDescriptionNewLine()
            .AppendDescription($"Completion Cost:", AppendOption.Italic).AppendDescription($" {item.Gold.Base} Gold");

            if (item.From != null)
            {
                message.AppendDescriptionNewLine(2)
                .AppendDescription("Components", AppendOption.Bold, AppendOption.Underscore);

                List <ItemDto> componentList = await this.GetFromList(item.From);

                componentList.Sort((a, b) => a.Gold.Base.CompareTo(b.Gold.Base));
                foreach (ItemDto component in componentList)
                {
                    message.AppendDescriptionNewLine()
                    .AppendDescription($"{component.Name} ({component.Gold.Base} Gold)");
                }
            }
            if (item.Into != null)
            {
                message.AppendDescriptionNewLine(2)
                .AppendDescription("Builds Into", AppendOption.Bold, AppendOption.Underscore);

                List <ItemDto> parentList = await this.GetFromList(item.Into);

                parentList.Sort((a, b) => a.Gold.Base.CompareTo(b.Gold.Base));
                foreach (ItemDto parent in parentList)
                {
                    message.AppendDescriptionNewLine()
                    .AppendDescription($"{parent.Name} ({parent.Gold.Base} Gold)");
                }
            }
        }