Ejemplo n.º 1
0
 private static ScreenUnit CreateScreenUnitForFinishPosition(MouseEventArgs newEvent)
 {
     return(new ScreenUnit
     {
         X = newEvent.ToScreenBlock().X,
         Y = newEvent.ToScreenBlock().Y,
         MousePassedCount = 0,
         MouseFinishedCount = 1,
         SpeedCount = 0,
     });
 }
Ejemplo n.º 2
0
        private IEnumerable <ScreenUnit> CreateScreenUnitsForAllIntermediatePositions(MouseEventArgs lastEvent, MouseEventArgs newEvent, long timeOfLastEvent, long timeOfNewEvent)
        {
            var intermediateScreenUnits = new List <ScreenUnit>();

            var speed = CalculateSpeed(lastEvent, newEvent, timeOfLastEvent, timeOfNewEvent);

            var coursorPath = CoursorPath.FromEndBlocks(lastEvent.ToScreenBlock(), newEvent.ToScreenBlock());

            foreach (Point screenBlock in coursorPath)
            {
                intermediateScreenUnits.Add(new ScreenUnit
                {
                    X = screenBlock.X,
                    Y = screenBlock.Y,
                    MousePassedCount   = 1,
                    MouseFinishedCount = 0,
                    SpeedCount         = speed,
                });
            }

            return(intermediateScreenUnits);
        }