Пример #1
0
        /// <summary>
        /// Clear all context flags on the context
        /// </summary>
        /// <param name="_flag"></param>
        public void ClearFlag(EContextFields _flag)
        {
            if (this == Global)
            {
                return;
            }

            m_existsFields &= ~_flag;
        }
Пример #2
0
 /// <summary>
 /// Get a context flag from the context.
 /// </summary>
 /// <param name="_field">The flag to get</param>
 /// <returns>True or False, depending the state of the flag requested</returns>
 internal bool GetFlag(EContextFields _field)
 {
     if (m_parent == null || IsSet(m_existsFields, _field))
     {
         // return this instance's context IF there's no parent OR the field exists in this context
         return(IsSet(m_instanceFields, _field));
     }
     else
     {
         return(m_parent.GetFlag(_field));
     }
 }
Пример #3
0
 internal void SetFlag(EContextFields _field, bool _state)
 {
     m_existsFields |= _field;
     if (_state)
     {
         m_instanceFields |= _field;
     }
     else
     {
         m_instanceFields &= ~_field;
     }
 }
Пример #4
0
 private static bool IsSet(EContextFields _set, EContextFields _field) => ((ushort)_set & (ushort)_field) != 0;