Пример #1
0
 /// <summary>
 /// Or
 /// </summary>
 /// <param name="other">Other flag</param>
 /// <returns></returns>
 public BitFlag Or(BitFlag other)
 {
     return(new BitFlag(Count())
     {
         Bits = Bits | other.Bits
     });
 }
Пример #2
0
 /// <summary>
 /// And
 /// </summary>
 /// <param name="other">Other flag</param>
 /// <returns></returns>
 public BitFlag And(BitFlag other)
 {
     return(new BitFlag(Count())
     {
         Bits = Bits & other.Bits
     });
 }
Пример #3
0
 /// <summary>
 /// Set flag
 /// </summary>
 /// <param name="other">Other flag</param>
 public void Set(BitFlag other)
 {
     Bits |= other.Bits;
 }
Пример #4
0
 /// <summary>
 /// Returns the other flag is set?
 /// </summary>
 /// <param name="other">Other flag</param>
 /// <returns>The other flag is set?</returns>
 public bool IsSet(BitFlag other)
 {
     return((Bits & other.Bits) != 0);
 }
Пример #5
0
 /// <summary>
 /// Count flags
 /// </summary>
 /// <returns>Count</returns>
 public bool Equals(BitFlag other)
 {
     return(Bits == other.Bits);
 }
Пример #6
0
 /// <summary>
 /// Constractor
 /// </summary>
 /// <param name="max">Max flags</param>
 public BitFlag(BitFlag other)
 {
     _maxbit = other._maxbit;
     Bits    = other.Bits;
 }
Пример #7
0
 /// <summary>
 /// Reset flag
 /// </summary>
 /// <param name="other">Other flag</param>
 public void Reset(BitFlag other)
 {
     Bits &= ~other.Bits;
 }