예제 #1
0
 // reset (for reuse)
 public void Reset(BitMap defaultBitmap)
 {
     DefaultBitmap = defaultBitmap;
     for (int i = 0; i < MAX_AND_BITMAPS; i++)
     {
         AndBitmaps[i] = null;
     }
     for (int i = 0; i < MAX_OR_BITMAPS; i++)
     {
         OrBitmaps[i] = OrBitmaps2[i] = null;
     }
     andBitmapCount = orBitmapCount = orBitmapCount2 = 0;
     conditions.Clear();
 }
예제 #2
0
 // add a bitmap to the 'and' group
 public void AndBitmap(BitMap bitMap)
 {
     if (andBitmapCount == MAX_AND_BITMAPS)
     {
         Log.Error("Too many AND-bitmaps in Finder");
         return;
     }
     if (bitMap == null)
     {
         DefaultBitmap = null;
     }
     else
     {
         AndBitmaps[andBitmapCount++] = bitMap;
     }
 }
예제 #3
0
 // copy constructor
 public Finder(Finder source)
 {
     DefaultBitmap  = source.DefaultBitmap;
     andBitmapCount = source.andBitmapCount;
     for (int i = 0; i < andBitmapCount; i++)
     {
         AndBitmaps[i] = source.AndBitmaps[i];
     }
     orBitmapCount = source.orBitmapCount;
     for (int i = 0; i < orBitmapCount; i++)
     {
         OrBitmaps[i] = source.OrBitmaps[i];
     }
     orBitmapCount2 = source.orBitmapCount2;
     for (int i = 0; i < orBitmapCount2; i++)
     {
         OrBitmaps2[i] = source.OrBitmaps2[i];
     }
     conditions.AddRange(source.conditions);
 }
예제 #4
0
 // replace a bitmap from the 'and' group
 public void SetBitmap(int index, BitMap bitMap)
 {
     AndBitmaps[index] = bitMap;
 }
예제 #5
0
 // constructor
 public Finder(BitMap defaultBitmap)
 {
     DefaultBitmap = defaultBitmap;
 }
예제 #6
0
 // helper to (re)set forward and reverse bitmaps
 private void updateBitmapPair(int id, BitMap positive, BitMap negative, bool isPositive)
 {
     positive.Set(id, isPositive);
     negative.Set(id, !isPositive);
 }