Exemplo n.º 1
0
        public Node GetDefautNode(Node node)
        {
            Node _n = null;

            foreach (var pos in positions)
            {
                _n = checkFind.GetNextIsNull(node, pos);
                if (_n != null)
                {
                    return(_n);
                }
            }
            if (_n == null)
            {
            }
            return(null);
        }
Exemplo n.º 2
0
        public void InitData(CheckFind checkFind)
        {
            Node max;
            Node min;
            bool isMax = false;
            bool isMin = false;

            if (this.Ls.Count <= 0)
            {
                return;
            }
            min = Top;
            max = After;
            if (this.Angle == Angle.HENG)
            {
                isMin = checkFind.CheckNextIsNull(min, Position.L);

                isMax = checkFind.CheckNextIsNull(max, Position.R);
                if (isMax)
                {
                    AfterNext       = checkFind.GetNextIsNull(max, Position.R);
                    AfterNext.Angle = this.Angle;
                    var n = checkFind.GetNextNode(AfterNext, Position.R, max.IsBlanck, 1);
                    if (n == null)
                    {
                        AfterNextNext = 0;
                    }
                    else
                    {
                        AfterNextNext = 1;
                    }
                }
                else if (isMin)
                {
                    TopNext       = checkFind.GetNextIsNull(min, Position.L);
                    TopNext.Angle = this.Angle;
                    var n = checkFind.GetNextNode(TopNext, Position.L, min.IsBlanck, 1);
                    if (n == null)
                    {
                        TopNextNext = 0;
                    }
                    else
                    {
                        TopNextNext = 1;
                    }
                }
            }
            else if (this.Angle == Angle.SHU)
            {
                isMin = checkFind.CheckNextIsNull(min, Position.T);
                isMax = checkFind.CheckNextIsNull(max, Position.D);
                if (isMax)
                {
                    AfterNext       = checkFind.GetNextIsNull(max, Position.D);
                    AfterNext.Angle = this.Angle;
                    var n = checkFind.GetNextNode(AfterNext, Position.D, max.IsBlanck, 1);
                    if (n == null)
                    {
                        AfterNextNext = 0;
                    }
                    else
                    {
                        AfterNextNext = 1;
                    }
                }
                else if (isMin)
                {
                    TopNext       = checkFind.GetNextIsNull(min, Position.T);
                    TopNext.Angle = this.Angle;
                    var n = checkFind.GetNextNode(TopNext, Position.T, min.IsBlanck, 1);
                    if (n == null)
                    {
                        TopNextNext = 0;
                    }
                    else
                    {
                        TopNextNext = 1;
                    }
                }
            }
            else if (this.Angle == Angle.ZX)
            {
                isMin = checkFind.CheckNextIsNull(min, Position.TL);
                isMax = checkFind.CheckNextIsNull(max, Position.DR);
                if (isMax)
                {
                    AfterNext       = checkFind.GetNextIsNull(max, Position.DR);
                    AfterNext.Angle = this.Angle;
                    var n = checkFind.GetNextNode(AfterNext, Position.DR, max.IsBlanck, 1);
                    if (n == null)
                    {
                        AfterNextNext = 0;
                    }
                    else
                    {
                        AfterNextNext = 1;
                    }
                }
                else if (isMin)
                {
                    TopNext       = checkFind.GetNextIsNull(min, Position.TL);
                    TopNext.Angle = this.Angle;
                    var n = checkFind.GetNextNode(TopNext, Position.TL, min.IsBlanck, 1);
                    if (n == null)
                    {
                        TopNextNext = 0;
                    }
                    else
                    {
                        TopNextNext = 1;
                    }
                }
            }
            else if (this.Angle == Angle.YX)
            {
                isMin = checkFind.CheckNextIsNull(min, Position.DL);
                isMax = checkFind.CheckNextIsNull(max, Position.TR);
                if (isMax)
                {
                    AfterNext       = checkFind.GetNextIsNull(max, Position.TR);
                    AfterNext.Angle = this.Angle;
                    var n = checkFind.GetNextNode(AfterNext, Position.TR, max.IsBlanck, 1);
                    if (n == null)
                    {
                        AfterNextNext = 0;
                    }
                    else
                    {
                        AfterNextNext = 1;
                    }
                }
                else if (isMin)
                {
                    TopNext       = checkFind.GetNextIsNull(min, Position.DL);
                    TopNext.Angle = this.Angle;
                    var n = checkFind.GetNextNode(TopNext, Position.DL, min.IsBlanck, 1);
                    if (n == null)
                    {
                        TopNextNext = 0;
                    }
                    else
                    {
                        TopNextNext = 1;
                    }
                }
            }

            if (isMin || isMax)
            {
                Block = 2;
            }
            if (!isMin && !isMax)
            {
                Block = -1;
            }
            if (isMin && isMax)
            {
                Block = 1;
            }
        }