public override object Clone() { GameBlockNormal clone = new GameBlockNormal(this.IndexRow, this.IndexColumn); clone.isAvailable = this.isAvailable; return(clone); }
public override void Copy(IGameBlock source) { GameBlockNormal gameBlockNormal = source as GameBlockNormal; if (gameBlockNormal != null) { this.isAvailable = gameBlockNormal.isAvailable; } }
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() { GameBlockNormal clone = new GameBlockNormal(this.IndexRow, this.IndexColumn); clone.isAvailable = this.isAvailable; return clone; }