public void Remove(FlagSet set) { if (set._fields.Length > _fields.Length) { Array.Resize <int>(ref _fields, set._fields.Length); } for (int ndx = 0; ndx < set._fields.Length; ndx++) { _fields[ndx] &= ~(set._fields[ndx]); } }
public void Add(FlagSet set) { if (set._fields.Length > _fields.Length) { Array.Resize <int>(ref _fields, set._fields.Length); } for (int ndx = 0; ndx < set._fields.Length; ndx++) { _fields[ndx] |= set._fields[ndx]; } }
/// <summary> /// Does THIS set have the flags in the parameter /// </summary> /// <param name="set"></param> /// <returns></returns> public bool HasFlags(FlagSet set) { if (set._fields.Length > _fields.Length) { Array.Resize <int>(ref _fields, set._fields.Length); } for (int ndx = 0; ndx < set._fields.Length; ndx++) { int and = set._fields[ndx] & _fields[ndx]; if (and != set._fields[ndx]) { return(false); } } return(true); }