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); }
// 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); }
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); }