示例#1
0
        public static BitBunch And(BitBunch mbfir, BitBunch mbsec)
        {
            BitBunch tBitBunch = new BitBunch();

            for (int i = 0; i < mbfir.mCount; i++)
            {
                tBitBunch.AddBit(mbfir.GetBit(i) & mbsec.GetBit(i));
            }
            return(tBitBunch);
        }
示例#2
0
        // Find the Entity having the key bitbunch
        List <UEntity> FindAllEntity(BitBunch mBitBunch)
        {
            List <UEntity> mList = new List <UEntity> ();

            for (int i = 0; i < mEntityCount; i++)
            {
                if (BitBunch.Equal(BitBunch.And(mBitBunch, mUEntity [i].mAllBitBunch), mBitBunch))
                {
                    mList.Add(mUEntity[i]);
                }
            }
            return(mList);
        }
示例#3
0
 public static bool Equal(BitBunch mbfir, BitBunch mbsec)
 {
     if (mbfir.mCount != mbsec.mCount)
     {
         return(false);
     }
     for (int i = 0; i < mbfir.mCount; i++)
     {
         if (mbfir.GetBit(i) != mbsec.GetBit(i))
         {
             return(false);
         }
     }
     return(true);
 }