public override object Clone()
        {
            GameBlockChangeDirection clone = new GameBlockChangeDirection(this.IndexRow, this.IndexColumn);

            clone.forceDirection = this.forceDirection;

            return(clone);
        }
Exemplo n.º 2
0
        public IGameBlock CreateGameBlock(
            GameBlockType gameBlockType,
            int row,
            int column,
            MovementDirection changeDirection = MovementDirection.Down,
            int numberOfMultipleMoves         = 2,
            int preferredMaxMoves             = 0)
        {
            IGameBlock gameBlock;

            switch (gameBlockType)
            {
            case GameBlockType.Null:
                gameBlock = new GameBlockNull(this, row, column);
                break;

            case GameBlockType.Normal:
                gameBlock = new GameBlockNormal(this, row, column);
                break;

            case GameBlockType.Player:
                gameBlock = new GameBlockPlayer(this, row, column, preferredMaxMoves);
                break;

            case GameBlockType.ChangeDirection:
                gameBlock = new GameBlockChangeDirection(this, row, column);
                (gameBlock as GameBlockChangeDirection).ForceDirection = changeDirection;
                break;

            case GameBlockType.ExtraMove:
                gameBlock = new GameBlockExtraMove(this, row, column);
                break;

            case GameBlockType.MultipleMoves:
                gameBlock = new GameBlockMultipleMoves(this, row, column);
                (gameBlock as GameBlockMultipleMoves).NumberOfMovesNeeded  = numberOfMultipleMoves;
                (gameBlock as GameBlockMultipleMoves).NumberOfMovesApplied = numberOfMultipleMoves;
                break;

            default:
                throw new ArgumentOutOfRangeException("gameBlockType");
            }

            return(gameBlock);
        }
        public override object Clone()
        {
            GameBlockChangeDirection clone = new GameBlockChangeDirection(this.IndexRow, this.IndexColumn);
            clone.forceDirection = this.forceDirection;

            return clone;
        }