本文整理匯總了C#中System.Drawing.PointD.XWhenAddYTo方法的典型用法代碼示例。如果您正苦於以下問題:C# PointD.XWhenAddYTo方法的具體用法?C# PointD.XWhenAddYTo怎麽用?C# PointD.XWhenAddYTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Drawing.PointD
的用法示例。
在下文中一共展示了PointD.XWhenAddYTo方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CheckCrash
static double CheckCrash()
{
double impulse = 0.0;
CRASHED = new bool[4] { Crash.Up, Crash.Left, Crash.Up || Crash.Down, Crash.Left || Crash.Right };
if (CRASHED[2] && !CRASHED[3]) impulse += Crash.Vertical(CRASHED[0]);
else if (CRASHED[3] && !CRASHED[2]) impulse += Crash.Horizontal(CRASHED[1]);
else if (CRASHED[2] && CRASHED[3])
{
if ((CRASHED[0] ? Corner.NothingUp : Corner.NothingDown) && (CRASHED[1] ? Corner.NothingLeft : Corner.NothingRight))
{
PointD p = new PointD(CRASHED[1] ? Corner.Left : Corner.Right, CRASHED[0] ? Corner.Up : Corner.Down);
PointD t = new PointD(CRASHED[1] ? Corner.LeftBlock + 1.0 : Corner.RightBlock, CRASHED[0] ? Corner.UpBlock + 1.0 : Corner.DownBlock);
bool y_needptoh = !CRASHED[0];
bool x_needptoh = CRASHED[1];
double v = p.XWhenAddYTo(t.Y, SPEED);
if (v.IsNaN())
{
v = p.YWhenAddXTo(t.X, SPEED);
if (!v.IsNaN())
{
if (y_needptoh == (v > t.Y)) impulse += Crash.Horizontal(CRASHED[1]);
else impulse += Crash.Vertical(CRASHED[0]);
}
}
else
{
if (x_needptoh == (v > t.X)) impulse += Crash.Horizontal(CRASHED[1]);
else impulse += Crash.Vertical(CRASHED[0]);
}
}
else impulse += Crash.Vertical(CRASHED[0]) + Crash.Horizontal(CRASHED[1]);
}
return impulse;
}