本文整理汇总了C#中Plane.GetPositionCount方法的典型用法代码示例。如果您正苦于以下问题:C# Plane.GetPositionCount方法的具体用法?C# Plane.GetPositionCount怎么用?C# Plane.GetPositionCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plane
的用法示例。
在下文中一共展示了Plane.GetPositionCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestPlaneConstructor
public static void TestPlaneConstructor()
{
PlaneAttributes atts = new PlaneAttributes("badger50", 1, 5, 3, 7, 2000);
Plane p = new Plane("acas-1200-badger50", atts);
//A plane should have anything assigned to it in the constructor reflected in it immediately.
p.attributes.maxHeight.ShouldBe(2000);
p.attributes.planeModelGUID.ShouldBe("badger50");
p.attributes.planeHeight.ShouldBe(3);
p.attributes.planeWidth.ShouldBe(5);
p.attributes.planeLength.ShouldBe(7);
p.attributes.planeClass.ShouldBe(1);
//A new plane should have no position data within it.
p.GetPositionCount().ShouldBe(0);
//A new plane with no position data should have a 'zero' velocity
p.IsClass(p.attributes.planeClass).ShouldBe(true);
Vector3d vel = p.GetVelocity();
vel.x.ShouldBe(0, .01);
vel.y.ShouldBe(0, .01);
vel.z.ShouldBe(0, .01);
//Getting position from a newly constructed plane (with no position data)
//should cause a NotSupportedException
Exception ex = null;
try {
Vector3d pos = p.GetPosition();
} catch (Exception e) {
ex = e;
}
ex.ShouldNotBeNull();
ex.GetType().ShouldBe(typeof(NotSupportedException));
}