【发布时间】:2014-02-12 21:39:11
【问题描述】:
抱歉,描述模糊。我有一个场景,当我在下面的代码中使用“North”时,有些东西不起作用。但是当我重新排列代码并将“North”定义为“X”时,它起作用了。对于我的一生,我不记得它是什么(那是另一门课,而不是下面的那门)。如果有任何区别,Bearing 是一个简单地包装一个双精度 (N) 并将其保持在 0 >= N
public struct Bearing : IComparable
{
#region Named Bearings
/// <summary>
/// A bearing representing North (this is the default)
/// </summary>
public static Bearing North = new Bearing(0.0);
public static Bearing X
{
get { return new Bearing(0.0); }
}
【问题讨论】:
标签: c# properties static