Пример #1
0
 public SingleBell(List <int> config, int length, TypeSorted sorted, TypeAlignCfg align)
 {
     _config = config;
     _show   = new int[0];
     Sorted  = sorted;
     Align   = align;
     Length  = length;
 }
Пример #2
0
 public BothBell(SingleBell parents, SingleBell child, TypeCompare compare, TypeSorted sorted, TypeAlignCfg align)
 {
     this._parents = parents;
     this._child   = child;
     Compare       = compare;
     Sorted        = sorted;
     Align         = align;
 }
Пример #3
0
        public int CompareTo(BothBell other)
        {
            // Сохраняем все настройки
            TypeSorted   sortedParentsThis  = this.Parents.Sorted;
            TypeSorted   sortedParentsOther = other.Parents.Sorted;
            TypeSorted   sortedChildThis    = this.Child.Sorted;
            TypeSorted   sortedChildOther   = other.Child.Sorted;
            TypeAlignCfg alignParentsThis   = this.Parents.Align;
            TypeAlignCfg alignParentsOther  = other.Parents.Align;
            TypeAlignCfg alignChildThis     = this.Child.Align;
            TypeAlignCfg alignChildOther    = other.Child.Align;

            // Производим установки в соответствии со свойствами класса BothBell
            this.Parents.Sorted  = this.Sorted;
            other.Parents.Sorted = this.Sorted;
            this.Child.Sorted    = this.Sorted;
            other.Child.Sorted   = this.Sorted;
            this.Parents.Align   = this.Align;
            other.Parents.Align  = this.Align;
            this.Child.Align     = this.Align;
            other.Child.Align    = this.Align;
            int result = this.Parents.CompareTo(other.Parents);

            if (result == 0)
            {
                result = this.Child.CompareTo(other.Child);
            }
            // Производим восстановление свойств объектов Parents и Child как в этом объекте, так и в объекте other
            this.Parents.Sorted  = sortedParentsThis;
            other.Parents.Sorted = sortedParentsOther;
            this.Child.Sorted    = sortedChildThis;
            other.Child.Sorted   = sortedChildOther;
            this.Parents.Align   = alignParentsThis;
            other.Parents.Align  = alignParentsOther;
            this.Child.Align     = alignChildThis;
            other.Child.Align    = alignChildOther;
            //
            return(result);
        }
Пример #4
0
 public SingleBell(List <int> config, TypeSorted sorted, TypeAlignCfg align) : this(config, config.Count, sorted, align)
 {
 }