本文整理汇总了C#中GameState.CanDouble方法的典型用法代码示例。如果您正苦于以下问题:C# GameState.CanDouble方法的具体用法?C# GameState.CanDouble怎么用?C# GameState.CanDouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameState
的用法示例。
在下文中一共展示了GameState.CanDouble方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoubleHint
public override DoubleHint DoubleHint(GameState gamestate)
{
Stopwatch sw = Stopwatch.StartNew();
DoubleHint hint = null;
if (gamestate.CanDouble())
hint = gnubg.DoubleHint(gamestate);
Console.WriteLine("[Double Hint] " + sw.ElapsedMilliseconds + "ms.");
return hint;
}
示例2: TimeOnTurnChanged
public override int TimeOnTurnChanged(GameState gamestate, DoubleHint doubleHint, ResignHint resignHint)
{
// Player has captured pieces, think less time.
if (gamestate.Board.CapturedCount(gamestate.PlayerOnRoll) > 0)
return (int)(coefficient * Gaussian.Next(700, 250, 20000, 500, 2.0));
if (!gamestate.CanDouble())
return (int)(coefficient * Gaussian.Next(400, 500, 20000, 1500, 2.0));
// Parameter Values
// Mean 1000 ms
// Minimum 500 ms
// Maximum 20000 ms
// Deviation 2.0 (95.4% are within 2000 ms from mean)
return (int)(coefficient * Gaussian.Next(1000, 1000, 20000, 1700, 2.0));
}
示例3: ToTurnInput
private Vector ToTurnInput(GameState gs, DoubleHint hint)
{
double ratio = 0.0;
Vector vector = null;
if (gs.CanDouble())
{
if (gs.GameType == GameType.Match)
{
ratio = System.Math.Min(
(System.Math.Max(gs.Score(0), gs.Score(1)) + gs.Cube.Value) / (double)gs.MatchTo,
1.0);
}
if (gs.GameType == GameType.Money)
{
ratio = System.Math.Min(gs.Cube.Value * gs.Stake / (double)gs.Limit, 1.0);
}
vector = new Vector(System.Math.Abs(System.Math.Min(hint.DoubleTakeEq, hint.DoublePassEq) - hint.NoDoubleEq),
ratio, 100.0);
}
else
{
vector = new Vector(0.0, ratio, 0.0);
}
return vector;
}