/// <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); }
/// <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); }