public Object Clone() { CustomBitArray bitArray = new CustomBitArray(m_array); bitArray._version = _version; bitArray.m_length = m_length; return(bitArray); }
public bool IsSuperSetOf(CustomBitArray other) { for (int i = 0; i < m_array.Length; i++) { var elem = m_array[i]; var otherElem = other.m_array[i]; if ((elem | otherElem) != elem) { return(false); } } return(true); }
/*========================================================================= ** Allocates a new BitArray with the same length and bit values as bits. ** ** Exceptions: ArgumentException if bits == null. ** =========================================================================*/ public CustomBitArray(CustomBitArray bits) { if (bits == null) { throw new ArgumentNullException("bits"); } //Contract.EndContractBlock(); int arrayLength = GetArrayLength(bits.m_length, BitsPerInt32); m_array = new int[arrayLength]; m_length = bits.m_length; Array.Copy(bits.m_array, m_array, arrayLength); _version = bits._version; }
/*========================================================================= ** Returns a reference to the current instance XORed with value. ** ** Exceptions: ArgumentException if value == null or ** value.Length != this.Length. ** =========================================================================*/ public CustomBitArray Xor(CustomBitArray value) { if (value == null) { throw new ArgumentNullException("value"); } if (Length != value.Length) { throw new ArgumentException("Array lengths differ"); } int ints = GetArrayLength(m_length, BitsPerInt32); for (int i = 0; i < ints; i++) { m_array[i] ^= value.m_array[i]; } _version++; return(this); }
public EntityMemberMask(EntityMemberMask clone) { Key = clone.Key; Entity = clone.Entity; Bits = new CustomBitArray(clone.Bits); }
public string Key; //some name-like identifier to use in ToString() method #endregion Fields #region Constructors public EntityMemberMask(string key, EntityInfo entity) { Key = key; Entity = entity; Bits = new CustomBitArray(Entity.Members.Count); }
internal BitArrayEnumeratorSimple(CustomBitArray bitarray) { this.bitarray = bitarray; this.index = -1; version = bitarray._version; }
/*========================================================================= ** Returns a reference to the current instance XORed with value. ** ** Exceptions: ArgumentException if value == null or ** value.Length != this.Length. =========================================================================*/ public CustomBitArray Xor(CustomBitArray value) { if (value==null) throw new ArgumentNullException("value"); if (Length != value.Length) throw new ArgumentException("Array lengths differ"); int ints = GetArrayLength(m_length, BitsPerInt32); for (int i = 0; i < ints; i++) { m_array[i] ^= value.m_array[i]; } _version++; return this; }
public bool IsSuperSetOf(CustomBitArray other) { for (int i = 0; i < m_array.Length; i++) { var elem = m_array[i]; var otherElem = other.m_array[i]; if ((elem | otherElem) != elem) return false; } return true; }
public bool IsSubSetOf(CustomBitArray other) { return other.IsSuperSetOf(this); }
public Object Clone() { CustomBitArray bitArray = new CustomBitArray(m_array); bitArray._version = _version; bitArray.m_length = m_length; return bitArray; }
/*========================================================================= ** Allocates a new BitArray with the same length and bit values as bits. ** ** Exceptions: ArgumentException if bits == null. =========================================================================*/ public CustomBitArray(CustomBitArray bits) { if (bits == null) { throw new ArgumentNullException("bits"); } //Contract.EndContractBlock(); int arrayLength = GetArrayLength(bits.m_length, BitsPerInt32); m_array = new int[arrayLength]; m_length = bits.m_length; Array.Copy(bits.m_array, m_array, arrayLength); _version = bits._version; }
public bool IsSubSetOf(CustomBitArray other) { return(other.IsSuperSetOf(this)); }
public EntityMemberMask(string key, EntityInfo entity) { Key = key; Entity = entity; Bits = new CustomBitArray(Entity.Members.Count); }