本文整理汇总了C#中Token.Reposition方法的典型用法代码示例。如果您正苦于以下问题:C# Token.Reposition方法的具体用法?C# Token.Reposition怎么用?C# Token.Reposition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Token
的用法示例。
在下文中一共展示了Token.Reposition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: dropToken
/// <summary>
/// Moves the given token, assuming it is the currently active token.
/// This means it checks for formed matches, but not broken; and it does some cleanup stuff.
/// </summary>
/// <param name="destX">Destination x.</param>
/// <param name="destY">Destination y.</param>
/// <param name="token">The token to move.</param>
private void dropToken(int destX, int destY, Token token)
{
token.active = false;
puzzleGrid[destX, destY] = token;
token.Reposition(destX, destY);
//check if match made
CheckForMatchesFinal(destX, destY);
}
示例2: moveToken
/// <summary>
/// Moves the given token, checking for broken/formed matches as well as moving it both logically and graphically
/// </summary>
/// <param name="destX">Destination x.</param>
/// <param name="destY">Destination y.</param>
/// <param name="token">The token to move.</param>
private void moveToken(int destX, int destY, Token token)
{
puzzleGrid[destX, destY] = token;
token.Reposition(destX, destY);
//if was in a previous match, check that match's viability
if(token.match != null)
ReevaluateMatch(token.match);
//check if match made
CheckForMatches(destX, destY);
}