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

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

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

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

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