internal override double GetFirstBorderCoordinate(DirectionBase dc)
        {
            double minVerticalX = double.MaxValue;

            //double minTiltedX;


            //First phase, we need to find the min X coordinate of the vertical border with in the path
            foreach (Border b in stateMachine.BorderVerifier.VerticalX)
            {
                double minBoxToPlaceY = dc.GetYPointTouchesBorder(stateMachine.CurrentBoxReference, this.GetType(), b);// stateMachine.CurrentBoxReference.MinY;
                if (minBoxToPlaceY >= b.Endpoints[0].coordinate1 && minBoxToPlaceY <= b.Endpoints[0].coordinate2)
                {
                    if (b.Coordinate < minVerticalX)
                    {
                        stateMachine.CurrentBoxReference.BorderUsedToGetRowStartX = b;
                        minVerticalX = b.Coordinate;
                    }
                }
            }

            //second phase, find the first tilted border within the path
            double firstTildedBorderCoordinate = dc.GetFirstPositiveTiltedBorder(FirstBorder);


            return(minVerticalX);
        }
Esempio n. 2
0
 //find out if the first border to hit in the current path is vertical or tilted
 internal static FirstBorderBase GetFirstBorderToHit(Machine stateMachine, DirectionBase dir)
 {
     if (dir is DirectionL2R)
     {
         return(GetFirstBorderL2R(stateMachine));
     }
     else
     {
         return(GetFirstBorderR2L(stateMachine));
     }
 }
Esempio n. 3
0
        internal override double GetFirstBorderCoordinate(DirectionBase dc)
        {
            double minVerticalX = double.MaxValue;
            double minTiltedX;
            double minBoxToPlaceY = stateMachine.CurrentBoxReference.MinY;

            //First phase, we need to find the min X coordinate of the vertical border with in the path
            foreach (Border b in stateMachine.BorderVerifier.HorizontalY)
            {
                if (minBoxToPlaceY >= b.Endpoints[0].coordinate1 && minBoxToPlaceY <= b.Endpoints[0].coordinate2)
                {
                    if (b.Coordinate < minVerticalX)
                    {
                        minVerticalX = b.Coordinate;
                    }
                }
            }

            //second phase, find the first tilted border within the path
            minTiltedX = dc.GetFirstNegativeTiltedBorder(FirstBorder);
            return(minTiltedX);
        }
Esempio n. 4
0
 internal abstract double GetFirstBorderCoordinate(DirectionBase dc);