Пример #1
0
        public void Pick(ISaver saver, int order)
        {
            IsResolved = true;
            var choice = SelectFrame;

            double score;

            if (choice == null)
            {
                choice = _frames.OrderByDescending(frame => frame.Score).First();
                score  = choice.Score / 100d;
            }
            else
            {
                score = choice.Score;
            }

            using (var result = new LayerResult(_rect)) {
                result.Order = order;
                result.Name  = choice.Name;
                result.Score = score;
                choice.CopyTo(result);

                saver.Set(result);
            }
        }
Пример #2
0
        public void CopyTo(LayerResult result)
        {
            int x, y;
            int posX, posY;

            for (x = 0, posX = _rect.Left; x < _rect.Width; x++, posX++)
            {
                for (y = 0, posY = _rect.Top; y < _rect.Height; y++, posY++)
                {
                    result.Set(x, y, _image.Raw[posX, posY]);
                }
            }
        }