Example #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((Sampler.GetHashCode() * 397) ^ Texture.GetHashCode());
     }
 }
Example #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((Variable.GetHashCode() * 397) ^ Version);
     }
 }
        public void VariableEqualityTest()
        {
            var dateTimeOffset = DateTimeOffset.Now;

            var left = new Variable
            {
                Name = "variable",
                Result = 3.5,
                Cmd = "command",
                CoreInfo = new DeviceDetails
                {
                    Connected = true,
                    DeviceId = "device",
                    LastApp = "lastapp",
                    LastHeard = dateTimeOffset
                }
            };

            var right = new Variable
            {
                Name = "variable",
                Result = 3.5,
                Cmd = "command",
                CoreInfo = new DeviceDetails
                {
                    Connected = true,
                    DeviceId = "device",
                    LastApp = "lastapp",
                    LastHeard = dateTimeOffset
                }
            };

            Assert.AreEqual(left.GetHashCode(), right.GetHashCode());
            Assert.AreEqual(left, right);
        }
Example #4
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashcode = Sampler == null ? 1 : Sampler.GetHashCode();
         return((hashcode * 397) ^ Texture.GetHashCode());
     }
 }
Example #5
0
        public override int GetHashCode()
        {
            int h = HashSalt;

            if (Variable != null)
            {
                h ^= Variable.GetHashCode();
            }
            return(h);
        }
Example #6
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (StatementId != null ? StatementId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Variable != null ? Variable.GetHashCode() : 0);
         return(hashCode);
     }
 }
 /// <summary>
 /// Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>
 /// A hash code for the current <see cref="T:System.Object"/>.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (int)Type;
         hashCode = (hashCode * 397) ^ (Label != null ? Label.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Variable != null ? Variable.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Operator != null ? Operator.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (GroupName != null ? GroupName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ GroupIndex;
         hashCode = (hashCode * 397) ^ (Value != null ? Value.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (MoreLink != null ? MoreLink.GetHashCode() : 0);
         return(hashCode);
     }
 }
 /// <summary>
 /// Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>
 /// A hash code for the current <see cref="T:System.Object"/>.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (int)Type;
         hashCode = (hashCode * 397) ^ (Label?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Variable?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Operator?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (GroupName?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ GroupIndex;
         hashCode = (hashCode * 397) ^ (Value?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (MoreLink?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
Example #9
0
        public void Equals()
        {
            Variable variable1 = new Variable("X");
            Variable variable2 = new Variable("Y");
            Variable variable3 = new Variable("X");

            Assert.AreEqual(variable1, variable3);
            Assert.AreEqual(variable3, variable1);

            Assert.AreEqual(variable1.GetHashCode(), variable3.GetHashCode());

            Assert.IsFalse(variable1.Equals(null));
            Assert.IsFalse(variable1.Equals(123));
            Assert.IsFalse(variable1.Equals("foo"));

            Assert.AreNotEqual(variable1, variable2);
            Assert.AreNotEqual(variable2, variable1);
        }
Example #10
0
        public override int GetHashCode()
        {
            int hash = 13;

            hash = (hash * 7) + Position.GetHashCode();
            hash = (hash * 7) + Variable.GetHashCode();
            foreach (ISymbol symbol in Rule)
            {
                hash = (hash * 17) + symbol.GetHashCode();
            }

            if (LookAhead != null)
            {
                foreach (Terminal terminal in LookAhead)
                {
                    hash = (hash * 5) + terminal.GetHashCode();
                }
            }

            return(hash);
        }
 /// <summary>
 /// Get the hash code identifying this object.
 /// </summary>
 /// <returns>The created hash code.</returns>
 public override int GetHashCode()
 {
     return(PathType.GetHashCode() ^ Variable.GetHashCode());
 }
Example #12
0
 public override int GetHashCode()
 {
     return(Variable.GetHashCode() * 31 + Expression.GetHashCode());
 }
Example #13
0
 public override int GetHashCode()
 {
     return(Var.GetHashCode());
 }
Example #14
0
 public override int GetHashCode()
 {
     return(Variable.GetHashCode() ^ SubValue.Value.GetHashCode());
 }
Example #15
0
 public override int GetHashCode()
 {
     return(Type.GetHashCode() ^ Variable.GetHashCode() * 8191);
 }
Example #16
0
 public override int GetHashCode()
 {
     return(Variable.GetHashCode() ^ ~SubstitutionTerm.GetHashCode());
 }
Example #17
0
 public override int GetHashCode()
 {
     return(Function.GetHashCode() * 2039 + Expression.GetHashCode() * 181 + Variable.GetHashCode() * 71);
 }
Example #18
0
 public override int GetHashCode()
 {
     return(itsVariable.GetHashCode());
 }
Example #19
0
 public override int GetHashCode() => _va.GetHashCode();