Example #1
0
        public static StringBuilder PrintMask(this FastBitMask64 ba, int greenbit = -1, bool[] redbits = null)
        {
            str.Length = 0;
            str._("[");
            for (int i = ba.BitCount - 1; i >= 0; --i)
            {
                if (i == greenbit)
                {
                    str._GrnB_(ba[i] ? 1 : 0);
                }
                else if (redbits != null && i < redbits.Length && redbits[i])
                {
                    str._RedB_(ba[i] ? 1 : 0);
                }
                else
                {
                    str._(ba[i] ? "1" : "<color=#0f0f0f>0</color>");
                }

                if (i % 32 == 0)
                {
                    str._((i == 0) ? "]" : "] [");
                }
                else if (i % 8 == 0 && i != 0)
                {
                    str._(":");
                }
            }

            return(str);
        }
Example #2
0
        public static StringBuilder PrintMask(this FastBitMask64 ba, StringBuilder[] colorbits = null)
        {
            str.Length = 0;
            str._("[");
            for (int i = ba.BitCount - 1; i >= 0; --i)
            {
                if (colorbits != null && i < colorbits.Length && colorbits[i] != null && colorbits[i].ToString() != "")
                {
                    str._("<b><color=" + colorbits[i].ToString() + ">" + (ba[i] ? 1 : 0) + "</color></b>");
                }
                else
                {
                    str._(ba[i] ? "1" : "<color=#0f0f0f>0</color>");
                }

                if (i % 32 == 0)
                {
                    str._((i == 0) ? "]" : "] [");
                }
                else if (i % 8 == 0 && i != 0)
                {
                    str._(":");
                }
            }

            return(str);
        }
Example #3
0
 private FastBitMask64(FastBitMask64 copyFrom)
 {
     this.bitmask  = copyFrom.bitmask;
     this.bitcount = copyFrom.bitcount;
     this.alltrue  = copyFrom.alltrue;
 }
Example #4
0
 public bool Compare(FastBitMask64 other)
 {
     return
         (bitcount == other.bitcount &&
          bitmask == other.bitmask);
 }
Example #5
0
 public void Copy(FastBitMask64 other)
 {
     bitcount = other.bitcount;
     bitmask  = other.bitmask;
     alltrue  = other.alltrue;
 }
Example #6
0
 public void XOR(FastBitMask64 other)
 {
     bitmask ^= other.bitmask;
 }
Example #7
0
 public void AND(FastBitMask64 other)
 {
     bitmask &= other.bitmask;
 }
Example #8
0
 public void OR(FastBitMask64 other)
 {
     bitmask |= other.bitmask;
 }