Exemplo n.º 1
0
                /// <summary>
                /// 移除队首的
                /// </summary>
                public void PopFirst()
                {
                    if (SkewPipes.Count == 0)
                    {
                        return;
                    }

                    SkewPipes.RemoveAt(0);
                    Lefts.RemoveAt(0);
                    Rights.RemoveAt(0);
                }
Exemplo n.º 2
0
                /// <summary>
                /// 移除队尾的
                /// </summary>
                public void PopLast()
                {
                    int index = SkewPipes.Count - 1;

                    if (index < 0)
                    {
                        return;
                    }

                    SkewPipes.RemoveAt(index);
                    Lefts.RemoveAt(index);
                    Rights.RemoveAt(index);
                }
Exemplo n.º 3
0
        public void SetListLength(int length)
        {
            while (Lefts.Count > length)
            {
                Rights.RemoveAt(Lefts.Count - 1);
                Lefts.RemoveAt(Lefts.Count - 1);
                Relation.RemoveAt(Lefts.Count - 1);
            }

            while (Lefts.Count < length)
            {
                Lefts.Add(new QPart {
                    Text = ""
                });
                Rights.Add(new QPart {
                    Text = ""
                });
                Relation.Add(Relation.Count);
            }
        }