示例#1
0
    private bool CheckForPossibleInputs()
    {
        bool hasPossibleInput = false;

        for (int row = 0; row < elementsPositions.GetLength(1); row++)
        {
            for (int collum = 0; collum < elementsPositions.GetLength(0); collum++)
            {
                changedPotitions[collum, row] = false;
                if (elementsPositions[collum, row].GetElementClassType() == typeof(CashBoardElement))
                {
                    continue;
                }
                else if (elementsPositions[collum, row].GetElementClassType() == typeof(BombBoardElement) || elementsPositions[collum, row].GetElementClassType() == typeof(BellBoardElement))
                {
                    hasPossibleInput = true;
                }
                else if (BoardFunctions.IsPotentialInput(collum, row, elementsPositions, matchedElemPositions, ConstantValues.totalCollums, ConstantValues.totalRows) > 0)
                {
                    //AlexDebugger.GetInstance().AddMessage(BoardFunctions.GetTransformByIndex(elementsPositions[collum, row].GetTransformIndex()) + " is potential input", AlexDebugger.tags.Step5);
                    BoardFunctions.ToggleHighlightCell(collum, row, this, true);
                    hasPossibleInput = true;
                }
                else
                {
                    BoardFunctions.ToggleHighlightCell(collum, row, this, false);
                }
            }
        }
        return(hasPossibleInput);
    }
示例#2
0
    private bool PlayEffectsStep()
    {
        BoardElement lastElementProcessed   = secondElement;
        bool         areThereChangesOnBoard = false;

        for (int row = 0; row < elementsPositions.GetLength(1); row++)
        {
            for (int collum = 0; collum < elementsPositions.GetLength(0); collum++)
            {
                if (matchedElemPositions[collum, row] == true)
                {
                    BoardFunctions.PlayMatchEffectAnimations(collum, row, this);
                    if (BoardFunctions.DestroyBoardElement(collum, row, this, lastElementProcessed))
                    {
                        areThereChangesOnBoard = true;
                    }
                }
                lastElementProcessed = elementsPositions[collum, row];
                BoardFunctions.ToggleHighlightCell(collum, row, this, false);
            }
        }

        if (!areThereChangesOnBoard)
        {
            AlexDebugger.GetInstance().AddMessage("Step2 finished: -play effects for matched elements-, go to Step3: -reorient elements- " + messagesToClient.Count, AlexDebugger.tags.Step2);
            return(true);
        }
        else
        {
            AlexDebugger.GetInstance().AddMessage("Step2 finished: -play effects for matched elements-, new elements has been destroyed, repeating step ", AlexDebugger.tags.Step2);
            return(false);
        }
    }