示例#1
0
        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]);
            }
        }
示例#2
0
        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];
            }
        }
示例#3
0
        /// <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);
        }