GetHashCode() public method

Returns a hash code.

public GetHashCode ( ) : int
return int
Esempio n. 1
0
 /// <summary>
 /// Returns a hash code for this instance of Kanji.DesktopApp.LogicLayer.Point.
 /// </summary>
 /// <returns>
 /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
 /// </returns>
 public override int GetHashCode()
 {
     Drawing.Point pt = new Drawing.Point((int)Math.Floor(X), (int)Math.Floor(Y));
     return(pt.GetHashCode() + Time.GetHashCode());
 }
Esempio n. 2
0
		public void GetHashCodeTest ()
		{
			Assert.AreEqual (0, pt1_1.GetHashCode (), "#1");
			Assert.AreEqual (1, pt1_0.GetHashCode (), "#2");
			Assert.AreEqual (1, pt0_1.GetHashCode (), "#3");
			Point pt = new Point(0xFF, 0xFF00);
			Assert.AreEqual (0xFFFF, pt.GetHashCode (), "#4");
		}