/// <summary> /// Or /// </summary> /// <param name="other">Other flag</param> /// <returns></returns> public BitFlag Or(BitFlag other) { return(new BitFlag(Count()) { Bits = Bits | other.Bits }); }
/// <summary> /// And /// </summary> /// <param name="other">Other flag</param> /// <returns></returns> public BitFlag And(BitFlag other) { return(new BitFlag(Count()) { Bits = Bits & other.Bits }); }
/// <summary> /// Set flag /// </summary> /// <param name="other">Other flag</param> public void Set(BitFlag other) { Bits |= other.Bits; }
/// <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); }
/// <summary> /// Count flags /// </summary> /// <returns>Count</returns> public bool Equals(BitFlag other) { return(Bits == other.Bits); }
/// <summary> /// Constractor /// </summary> /// <param name="max">Max flags</param> public BitFlag(BitFlag other) { _maxbit = other._maxbit; Bits = other.Bits; }
/// <summary> /// Reset flag /// </summary> /// <param name="other">Other flag</param> public void Reset(BitFlag other) { Bits &= ~other.Bits; }