The easy to use and full featured Irc Bot everyone is talking about!
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

CommandArgument.cs 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using System.Collections.Generic;
  2. namespace Combot.Modules
  3. {
  4. public class CommandArgument
  5. {
  6. public string Name { get; set; }
  7. public string Description { get; set; }
  8. public List<string> AllowedValues { get; set; }
  9. public List<DependentArgumentInfo> DependentArguments { get; set; }
  10. public List<MessageType> MessageTypes { get; set; }
  11. public bool Required { get; set; }
  12. public CommandArgument()
  13. {
  14. SetDefaults();
  15. }
  16. public void SetDefaults()
  17. {
  18. Name = string.Empty;
  19. Description = string.Empty;
  20. AllowedValues = new List<string>();
  21. DependentArguments = new List<DependentArgumentInfo>();
  22. MessageTypes = new List<MessageType>();
  23. Required = false;
  24. }
  25. public void Copy(CommandArgument argument)
  26. {
  27. Name = argument.Name;
  28. Description = argument.Description;
  29. AllowedValues = new List<string>();
  30. foreach (string value in argument.AllowedValues)
  31. {
  32. AllowedValues.Add(value);
  33. }
  34. DependentArguments = new List<DependentArgumentInfo>();
  35. foreach (DependentArgumentInfo value in argument.DependentArguments)
  36. {
  37. DependentArguments.Add(value);
  38. }
  39. MessageTypes = new List<MessageType>();
  40. foreach (MessageType value in argument.MessageTypes)
  41. {
  42. MessageTypes.Add(value);
  43. }
  44. Required = argument.Required;
  45. }
  46. public class DependentArgumentInfo
  47. {
  48. public string Name { get; set; }
  49. public List<string> Values { get; set; }
  50. public DependentArgumentInfo()
  51. {
  52. SetDefaults();
  53. }
  54. public void SetDefaults()
  55. {
  56. Name = string.Empty;
  57. Values = new List<string>();
  58. }
  59. }
  60. }
  61. }