当前位置: 首页>>代码示例>>C#>>正文


C# Point3D.CompareTo方法代码示例

本文整理汇总了C#中Point3D.CompareTo方法的典型用法代码示例。如果您正苦于以下问题:C# Point3D.CompareTo方法的具体用法?C# Point3D.CompareTo怎么用?C# Point3D.CompareTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Point3D的用法示例。


在下文中一共展示了Point3D.CompareTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Point3D

		public void Point3D()
		{
			//Do various Point method calls to cover the point class with sufficient testing
			Point3D p0 = new Point3D();
			Point p = new Point(23, 21);
			Point3D p1 = new Point3D(450, 120, 34);
			Point3D p2 = new Point3D(p, 94);
			Assert.IsTrue(p0.IsEmpty());
			Assert.IsFalse(p1.IsEmpty());
			Assert.IsFalse(p2.IsEmpty());

			Assert.AreNotEqual(p, p2);
			Assert.AreEqual(94, p2.Z);

			Assert.AreNotSame(p1.Clone(), p1);
			p0 = p1.Clone();
			p0.X += 100;
			p0.Y = 150;
			p0.Z += 499;
			p0[2] += p0[2];
			Assert.AreEqual(new Point3D(550, 150, 1066), p0);
			Assert.AreEqual(p2.AsPoint(), p2.GetBoundingBox().Min);
			Assert.AreEqual(p2.AsPoint(), p2.GetBoundingBox().Max);
			Assert.AreEqual(3, p2.NumOrdinates);
			Assert.AreEqual(new Point3D(-27, 1, 123), p2 + new Point3D(-50, -20, 29));
			Assert.AreEqual(new Point(73, 1), p2 - new Point(-50, 20));
			Assert.AreEqual(new Point3D(46, 42, 188), p2*2);
			Assert.AreEqual(0, p2.Dimension);
			Assert.AreEqual(23, p2[0]);
			Assert.AreEqual(21, p2[1]);
			Assert.AreEqual(94, p2[2]);
			Assert.IsNull(p2.Boundary());
			Assert.AreEqual(p2.X.GetHashCode() ^ p2.Y.GetHashCode() ^ p2.Z.GetHashCode() ^ p2.IsEmpty().GetHashCode(),
			                p2.GetHashCode());
			Assert.Less(p2.CompareTo(p1), 0);
			Assert.Greater(p1.CompareTo(p2), 0);
			Assert.AreEqual(0, p2.CompareTo(new Point3D(23, 21, 94)));
			Assert.AreEqual(0, p2.CompareTo(new Point(23, 21)));
		}
开发者ID:sridhar19091986,项目名称:sharpmapcf,代码行数:39,代码来源:PointTests.cs

示例2: CompareToTest

 public void CompareToTest()
 {
     Point3D target = new Point3D(); // TODO: 初始化为适当的值
     object other = null; // TODO: 初始化为适当的值
     int expected = 0; // TODO: 初始化为适当的值
     int actual;
     actual = target.CompareTo( other );
     Assert.AreEqual( expected, actual );
     Assert.Inconclusive( "验证此测试方法的正确性。" );
 }
开发者ID:andyhebear,项目名称:HappyQ-WowServer,代码行数:10,代码来源:Point3DTest.cs

示例3: GetMapTile

		public MapTile GetMapTile( Point3D p ) {
			if( p.CompareTo( this ) == false )
				return null;

			return GetMapTile( p.X, p.Y );
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:6,代码来源:Map.cs


注:本文中的Point3D.CompareTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。