Esempio n. 1
0
	public bool IsValidSwap(GemSwapData data)
	{
		if ((data.indexA == index1 && data.indexB == index2) || (data.indexA == index2 && data.indexB == index1))
		{
			return true;
		}
		return false;
	}
Esempio n. 2
0
    void GemSwapper_Swapped(object sender, GemSwapEventArgs e)
    {
        Debug.Log("PuzzleGameController Swapped Event");
        GemSwapData swap = new GemSwapData(e.indexA, e.indexB, e.isValid);

        e.isValid = PresentationMatchChecker.Instance.CheckForValidSwap(swap);
        PuzzlePresentationController.SwapTwoGems(e.indexA, e.indexB, e.isValid);
    }
Esempio n. 3
0
 public bool IsValidSwap(GemSwapData data)
 {
     if ((data.indexA == index1 && data.indexB == index2) || (data.indexA == index2 && data.indexB == index1))
     {
         return(true);
     }
     return(false);
 }
Esempio n. 4
0
    public bool CheckForValidSwap(GemSwapData swap)
    {
        var retval = false;

        PuzzlePresentation.Instance.SwapTwoGridCellsStraight(swap.indexA, swap.indexB);
        var match1x = GetOneIndexMatchData(swap.indexA);
        var match2x = GetOneIndexMatchData(swap.indexB);

        if (match1x != null || match2x != null)
        {
            retval = true;
        }
        PuzzlePresentation.Instance.SwapTwoGridCellsStraight(swap.indexA, swap.indexB);
        return(retval);
    }
Esempio n. 5
0
	public bool CheckForValidSwap(GemSwapData data)
	{
		if (allowAllSwaps == true)
			return true;
		//don't check the possible moves, just check the board
		PuzzleBoard.SwapTwoGems(data.indexA, data.indexB);
		CheckBoardForMatches();
		PuzzleBoard.SwapTwoGems(data.indexA, data.indexB);

/*		foreach (PossibleMoveData move in PossibleMoves)
		{
			if (move.IsValidSwap(data))
				return true;
		}*/
		return BoardMatchData.MatchedCount() > 0;
	}
Esempio n. 6
0
    public bool CheckForValidSwap(GemSwapData data)
    {
        if (allowAllSwaps == true)
        {
            return(true);
        }
        //don't check the possible moves, just check the board
        PuzzleBoard.SwapTwoGems(data.indexA, data.indexB);
        CheckBoardForMatches();
        PuzzleBoard.SwapTwoGems(data.indexA, data.indexB);

/*		foreach (PossibleMoveData move in PossibleMoves)
 *              {
 *                      if (move.IsValidSwap(data))
 *                              return true;
 *              }*/
        return(BoardMatchData.MatchedCount() > 0);
    }
Esempio n. 7
0
	void GemSwapper_Swapped(object sender, GemSwapEventArgs e)
	{
		Debug.Log("PuzzleGameController Swapped Event");
		GemSwapData swap = new GemSwapData(e.indexA, e.indexB, e.isValid);
		e.isValid = PresentationMatchChecker.Instance.CheckForValidSwap(swap);
		PuzzlePresentationController.SwapTwoGems(e.indexA, e.indexB, e.isValid);
	}
	public bool CheckForValidSwap(GemSwapData swap)
	{
		var retval = false;
		PuzzlePresentation.Instance.SwapTwoGridCellsStraight(swap.indexA, swap.indexB);
		var match1x = GetOneIndexMatchData(swap.indexA);
		var match2x = GetOneIndexMatchData(swap.indexB);
		if (match1x != null || match2x != null)
		{
			retval = true;
		}
		PuzzlePresentation.Instance.SwapTwoGridCellsStraight(swap.indexA, swap.indexB);
		return retval;
	}