Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static Dictionary<string, MethodInfo> CommandList = new Dictionary<string, MethodInfo>();
- static CommandManager()
- {
- CommandList = Assembly.GetExecutingAssembly().GetTypes()
- .SelectMany(t => t.GetMethods())
- .Where(m => m.GetCustomAttributes(typeof(ChatCommandAttribute), false).Length > 0)
- .ToDictionary(m => m.Name.ToLower(), m => m);
- }
- [AttributeUsage(AttributeTargets.Method)]
- public class ChatCommandAttribute : Attribute
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement