Example #1
0
        public static UsingDirectiveSyntax ToUsingDirective(this NameSyntax name, bool @static = false)
        {
            var directive = UsingDirective(name);

            return(@static
                                ? directive.WithStaticKeyword(StaticKeyword.ToToken())
                                : directive);
        }
Example #2
0
        public async Task KeywordCards(CommandContext ctx, string keyword)
        {
            StaticKeyword checkKw = new StaticKeyword();
            bool          exists  = false;

            foreach (var kw in Enum.GetValues(typeof(StaticKeyword)))
            {
                if (keyword.Equals(kw.ToString(), StringComparison.OrdinalIgnoreCase))
                {
                    exists  = true;
                    checkKw = (StaticKeyword)kw;
                    break;
                }
            }

            if (!exists)
            {
                return;
            }

            string output  = string.Empty;
            int    results = 0;

            foreach (var u in BotInfoHandler.gameHandler.pool.upgrades)
            {
                if (u.creatureData.staticKeywords[checkKw] > 0 && Attribute.IsDefined(u.GetType(), typeof(SetAttribute)))
                {
                    results++;
                    output += $"{u.name}";

                    output += $" ({((SetAttribute)Attribute.GetCustomAttribute(u.GetType(), typeof(SetAttribute))).Set})\n";
                }
            }

            await ctx.RespondAsync(embed : new DiscordEmbedBuilder {
                Title       = $"{results} Upgrades Found With The Keyword {checkKw}",
                Description = output,
                Color       = DiscordColor.Azure
            }).ConfigureAwait(false);
        }
 public SyntaxToken Convert(StaticKeyword node)
 {
     return(SyntaxFactory.Token(SyntaxKind.StaticKeyword));
 }