Ejemplo n.º 1
0
 public Память(Память a)
 {
     // Конструктор копирования объекта.
     InputCount          = a.InputCount;
     inputValues         = new byte[InputCount];
     straightOutputValue = a.straightOutputValue;
     inversOutputValue   = a.inversOutputValue;
     a.inputValues.CopyTo(inputValues, 0);
 }
Ejemplo n.º 2
0
 public егистр()
 {
     set         = 1;
     memory      = new Память[capacity];
     inputValues = new byte[capacity, inOutCount];
     for (int i = 0; i < capacity; ++i)
     {
         memory[i] = new Память();
     }
 }
Ejemplo n.º 3
0
 public егистр(string name, byte[,] inpVal)
 {
     set         = 1;
     memory      = new Память[capacity];
     inputValues = new byte[capacity, inOutCount];
     Array.Copy(inpVal, inputValues, capacity * inOutCount);
     byte[] row = new byte[inOutCount];
     for (int i = 0; i < capacity; ++i)
     {
         for (int j = 0; j < inOutCount; ++j)
         {
             row[j] = inputValues[i, j];
         }
         //Array.Copy(inputValues, i * inOutCount, row, 0, inOutCount); // работает для массивов одинаковой размерности
         memory[i] = new Память(name, row);
     }
 }
Ejemplo n.º 4
0
            public override int CompareTo(object obj)
            {
                // Сравнение по значению на прямом выходе.
                if ((object)this == obj)
                {
                    return(0);
                }
                Память tmp = (Память)obj;

                if (this.straightOutputValue < tmp.straightOutputValue)
                {
                    return(-1);
                }
                if (this.straightOutputValue > tmp.straightOutputValue)
                {
                    return(1);
                }
                return(0);
            }
Ejemplo n.º 5
0
            public override bool Equals(object a)
            {
                // Если оба объекта содержать null, то они равны, если только один из них, то не равны.
                if (a == null && (object)this == null)
                {
                    return(true);
                }
                if (a == null || (object)this == null)
                {
                    return(false);
                }
                // Если метод стравнения объекта взван для самого объекта.
                if ((object)this == a)
                {
                    return(true);
                }
                // Если типы объектов не совпадают, то объекты не равны.
                if (a.GetType() != GetType())
                {
                    return(false);
                }
                Память tmp = (Память)a;

                if (tmp.inputValues.Length != inputValues.Length)
                {
                    return(false);
                }
                int f = 0;

                foreach (byte i in tmp.inputValues)
                {
                    if (i != inputValues[f++])
                    {
                        return(false);
                    }
                }
                return(true);
            }
Ejemplo n.º 6
0
 public МВЫБ(Память память, Плюс плюс, Проводки проводки)
 {
     this.память = память;
     this.плюс = плюс;
     this.проводки = проводки;
 }
Ejemplo n.º 7
0
 public void Инициализируйся(Память память)
 {
     this.память = память;
 }
Ejemplo n.º 8
0
 public МВЫБ(Память память, Плюс плюс, Проводки проводки)
 {
     this.память   = память;
     this.плюс     = плюс;
     this.проводки = проводки;
 }
Ejemplo n.º 9
0
 public void Инициализируйся(Память память)
 {
     this.память = память;
 }