示例#1
0
    public override bool OnElementDestruction(BoardManager board)
    {
        if (hasBeenDestroyed)
        {
            return(false);
        }
        KeyValuePair <int, int> pos = BoardFunctions.GetBoardPositionOfElement(this, board.elementsPositions);

        switch (thisBombStyle)
        {
        case BombExplosionStyle.CrossStyle:
            BoardFunctions.DestroyAllElementsCrossStyle(pos.Key, pos.Value, ref board.matchedElemPositions);
            break;

        case BombExplosionStyle.DoubleBombStyle:
            BoardFunctions.DestroyElementsDoubleBombStyle(pos.Key, pos.Value, ref board.matchedElemPositions);
            break;

        case BombExplosionStyle.NormalStyle:
            BoardFunctions.DestroyElementsBombStyle(pos.Key, pos.Value, ref board.matchedElemPositions);
            break;

        default:
            BoardFunctions.DestroyElementsBombStyle(pos.Key, pos.Value, ref board.matchedElemPositions);
            break;
        }
        board.matchedElemPositions[pos.Key, pos.Value] = true;
        hasBeenDestroyed = true;
        return(true);
    }