internal MemeCommand(IErrorLogger errorLogger, PleaseWaitHandler waitHandler, IAsyncResponder asyncResponder, LanguageHandler languageHandler, string[] aliases, string examples, string help, ModuleType module, string template, Point topLeft, Point topRight, Point bottomLeft) : this(errorLogger, waitHandler, asyncResponder, languageHandler, aliases, examples, help, module, template) { this.topLeft = topLeft; this.topRight = topRight; this.bottomLeft = bottomLeft; Debug.Assert(topLeft.Y < bottomLeft.Y && topRight.Y < bottomLeft.Y && bottomLeft.X < topRight.X && topLeft.X < topRight.X); }
internal ASCIICommand(IErrorLogger errorLogger, PleaseWaitHandler waitHandler, IAsyncResponder asyncResponder, LanguageHandler languageHandler, string[] aliases, string examples, string help, ModuleType module) : base(CommandHandlerType.ASCII, aliases, examples, help, module) { this.errorLogger = errorLogger; this.waitHandler = waitHandler; this.asyncResponder = asyncResponder; this.languageHandler = languageHandler; }
// private readonly List<CorrelationData> pokemonStdDevs; internal PokemonCommand(SlateBotController controller, string[] aliases, string examples, string help, ModuleType module) : base(CommandHandlerType.PokemonType, aliases, examples, help, module) { this.languageHandler = controller.languageHandler; this.waitHandler = controller.waitHandler; this.asyncResponder = controller; this.dal = controller.dal; this.errorLogger = dal.errorLogger; // Build the database // this.pokemonStdDevs = dal.PokemonSDevs; }
internal MemeCommand(IErrorLogger errorLogger, PleaseWaitHandler waitHandler, IAsyncResponder asyncResponder, LanguageHandler languageHandler, string[] aliases, string examples, string help, ModuleType module, string templatePath) : base(CommandHandlerType.Meme, aliases, examples, help, module) { this.errorLogger = errorLogger; this.waitHandler = waitHandler; this.asyncResponder = asyncResponder; this.languageHandler = languageHandler; this.templatePath = templatePath; // Calculate the points. // CalculatePoints(); int lowX = int.MaxValue, lowY = int.MaxValue; int highX = int.MinValue, highY = int.MinValue; using (Bitmap template = new Bitmap(templatePath)) { for (int x = 0; x < template.Width; x++) { for (int y = 0; y < template.Height; y++) { if (template.GetPixel(x, y).A == 0) { if (x < lowX) { lowX = x; } if (x > highX) { highX = x; } if (y < lowY) { lowY = y; } if (y > highY) { highY = y; } } } } } this.topLeft = new Point(lowX, lowY); this.topRight = new Point(highX, lowY); this.bottomLeft = new Point(lowX, highY); Debug.Assert(topLeft.Y < bottomLeft.Y && topRight.Y < bottomLeft.Y && bottomLeft.X < topRight.X && topLeft.X < topRight.X); }