Пример #1
0
    private void HandleExplosionWithNoDirection(GridElement neighbor, int inputRefundValue)
    {
        int newRefundValue = inputRefundValue;
        bool eitherIsWhite = white || neighbor.white;
        bool colorMatchesNeighbor = ColorMatches(neighbor);

        if(!neighbor.readyToExplode){
            if(canChain){
                Direction newDirection = GetDirection(colorIndex, neighbor.colorIndex);
                bool newCascade = newDirection != Direction.None;
                bool neighborIsSame = ColorMatches (neighbor) && newDirection == Direction.None;
                if(eitherIsWhite || newCascade || neighborIsSame){
                    if(newDirection != Direction.None && !colorMatchesNeighbor){
                        newRefundValue += 1;
                    }
                    neighbor.SetExplode(newDirection, newRefundValue);
                }
            }else{
                if(eitherIsWhite || colorMatchesNeighbor){
                    neighbor.SetExplode(Direction.None, newRefundValue);
                }
            }
        }
    }
Пример #2
0
    private void HandleExplosionWithDirection(GridElement neighbor, int inputRefundValue)
    {
        bool eitherIsWhite = white || neighbor.white;
        int newRefundValue = inputRefundValue;

        if(!neighbor.readyToExplode){
            if((eitherIsWhite || ColorMatches (neighbor) || DirectionMatchesNeighbor(explosionDirection, neighbor)) || (newRefundValue >= 6 && neighbor.Disabled ())){
                if(colorIndex != neighbor.colorIndex){
                    newRefundValue += 1;
                }
                neighbor.SetExplode(explosionDirection, newRefundValue);
            }

        }
    }