예제 #1
0
        public override bool Equals(object obj)
        {
            if (!(obj is WatchVariableLock))
            {
                return(false);
            }
            WatchVariableLock other = (WatchVariableLock)obj;

            return(this.IsSpecial == other.IsSpecial &&
                   this.MemoryType == other.MemoryType &&
                   this.ByteCount == other.ByteCount &&
                   this.Mask == other.Mask &&
                   this.Address == other.Address &&
                   this.SpecialType == other.SpecialType);
        }
예제 #2
0
        public override bool Equals(object obj)
        {
            if (!(obj is WatchVariableLock))
            {
                return(false);
            }
            WatchVariableLock other = (WatchVariableLock)obj;

            bool sameAddress = this.Address == other.Address &&
                               this.ByteCount == other.ByteCount &&
                               this.MemoryType == other.MemoryType;

            WatchVariableLock lock1 = this.Address < other.Address ? this : other;
            WatchVariableLock lock2 = this.Address < other.Address ? other : this;
            bool closeAddress       = lock1.Address + 2 == lock2.Address &&
                                      (lock1.MemoryType == typeof(uint) || lock1.MemoryType == typeof(int)) &&
                                      (lock2.MemoryType == typeof(ushort) || lock2.MemoryType == typeof(short));

            return((sameAddress || closeAddress) &&
                   this.IsSpecial == other.IsSpecial &&
                   this.Mask == other.Mask &&
                   this.Shift == other.Shift &&
                   this.SpecialType == other.SpecialType);
        }