Exemple #1
0
        public void UpdatePoints()
        {
            int points;

            try
            {
                points = Convert.ToInt32(NMZPointsScreenReader.ScreenToNMZPoints());

                if (points == -1 || points == Points || points > 1048575)
                {
                    return;
                }
            }
            catch (Exception)
            {
                return;
            }
            var args = new MonsterKilledArgs {
                Points = points - Points
            };

            if (MonsterKilled != null)
            {
                MonsterKilled(this, args);
            }

            Points = points;

            Calculator.UpdatePoints(Convert.ToInt32(points));
        }
Exemple #2
0
 public Dream()
 {
     active                = false;
     Points                = -1;
     Calculator            = new PointsCalculator();
     NMZPointsScreenReader = new NMZPointsScreenReader();
     Id = 0;
 }
Exemple #3
0
 public void Start()
 {
     active = true;
     try
     {
         Points = Convert.ToInt32(NMZPointsScreenReader.ScreenToNMZPoints());
     }
     catch (Exception)
     {
         Points = 0;
     }
     Calculator.Start(Points);
 }
        public void SetUp()
        {
            nmzPointsScreenReader = new NMZPointsScreenReader();

            var ssTaker       = Substitute.For <IScreenshotTaker>();
            var pointsFinder  = Substitute.For <INMZPointsImageFinder>();
            var ocr           = Substitute.For <IOpticalNumberRecognizer>();
            var imageFilterer = Substitute.For <IImageFilterer>();
            var separator     = Substitute.For <IOpticalNumberSeparator>();

            separator.Separate(new Bitmap(1, 1)).ReturnsForAnyArgs(new List <Bitmap>());
            pointsFinder.FindNMZPoints(new Bitmap(1, 1)).ReturnsForAnyArgs(new Bitmap(10, 10));

            nmzPointsScreenReader.ScreenShotTaker      = ssTaker;
            nmzPointsScreenReader.NmzPointsImageFinder = pointsFinder;
            nmzPointsScreenReader.OCR           = ocr;
            nmzPointsScreenReader.ImageFilterer = imageFilterer;
            nmzPointsScreenReader.Separator     = separator;
        }