示例#1
0
 public static bool Equals(Intarray a, Intarray b)
 {
     if (a.Length() != b.Length()) return false;
     for (int i = 0; i < a.Length(); i++)
         if (a.UnsafeAt1d(i) != b.UnsafeAt1d(i)) return false;
     return true;
 }
示例#2
0
 public float this[int index]
 {
     get
     {
         for (int j = 0; j < _keys.Length(); j++)
         {
             if (_keys.UnsafeAt1d(j) == index)
             {
                 return(_values[j]);
             }
         }
         _keys.Push(index);
         _values.Push(0f);
         if (index >= _len)
         {
             _len = index + 1;
         }
         return(_values.Last());
     }
     set
     {
         for (int j = 0; j < _keys.Length(); j++)
         {
             if (_keys.UnsafeAt1d(j) == index)
             {
                 _values[j] = value;
                 return;
             }
         }
         _keys.Push(index);
         _values.Push(value);
         if (index >= _len)
         {
             _len = index + 1;
         }
     }
 }
示例#3
0
 public static bool Equals(Intarray a, Intarray b)
 {
     if (a.Length() != b.Length())
     {
         return(false);
     }
     for (int i = 0; i < a.Length(); i++)
     {
         if (a.UnsafeAt1d(i) != b.UnsafeAt1d(i))
         {
             return(false);
         }
     }
     return(true);
 }