本文整理汇总了C#中Situation.ClearAnimations方法的典型用法代码示例。如果您正苦于以下问题:C# Situation.ClearAnimations方法的具体用法?C# Situation.ClearAnimations怎么用?C# Situation.ClearAnimations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Situation
的用法示例。
在下文中一共展示了Situation.ClearAnimations方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisplaySituationHandler
private void DisplaySituationHandler(Situation situation)
{
CreateStoryBoard(situation.HasMultistepAnimation());
for (int i = 0; i < situation.animations.Length; i++)
{
if (situation.animations[i] != null)
{
foreach (Situation.Animation animation in situation.animations[i])
{
AnimatePieceToPosition(animation.Piece, animation.Start, animation.End, i);
}
}
}
StartAnimation();
situation.ClearAnimations();
// When animation is done, move all pieces to correct positions to account for non-animated moves
board.Completed += (sender, args) =>
{
for (int i = 0; i < situation.pieces.Length; i++)
{
Point p = GetAbsolutePosition(situation.pieces[i]);
Canvas.SetLeft(pieces[i], p.X);
Canvas.SetTop(pieces[i], p.Y);
}
};
GreenBeer.BeerCount = situation.beers[(int)Piece.Green];
RedBeer.BeerCount = situation.beers[(int)Piece.Red];
BlueBeer.BeerCount = situation.beers[(int)Piece.Blue];
YellowBeer.BeerCount = situation.beers[(int)Piece.Yellow];
GreenTurnsLabel.Content = SinglePlayerData.Instance.GetTurnsRemainingExpectedValue(situation, Piece.Green).ToString("f2");
RedTurnsLabel.Content = SinglePlayerData.Instance.GetTurnsRemainingExpectedValue(situation, Piece.Red).ToString("f2");
BlueTurnsLabel.Content = SinglePlayerData.Instance.GetTurnsRemainingExpectedValue(situation, Piece.Blue).ToString("f2");
YellowTurnsLabel.Content = SinglePlayerData.Instance.GetTurnsRemainingExpectedValue(situation, Piece.Yellow).ToString("f2");
}