private GameShape GetShapeInBoardSlotAtOffset(BoardPosition offset) { GameShape gameShape = (GameShape)null; BoardPosition pos = BoardPosition.AddBoardPositions(this.boardPos, offset); if (this.ParentGameBoard.CreateSafeBoardPosition(ref pos)) { BoardSlot boardSlotForPosition = this.ParentGameBoard.GetBoardSlotForPosition(pos); if (boardSlotForPosition != null) { gameShape = boardSlotForPosition.FilledShape; } } return(gameShape); }
private GameShape GetShapeInBoardSlotAtOffset(BoardPosition offset, bool bIgnoreSameFilledShape) { GameShape gameShape = (GameShape)null; BoardPosition pos = BoardPosition.AddBoardPositions(this.boardPos, offset); if (this.ParentGameBoard.CreateSafeBoardPosition(ref pos)) { BoardSlot boardSlotForPosition = this.ParentGameBoard.GetBoardSlotForPosition(pos); if (boardSlotForPosition != null && boardSlotForPosition.HasFilledShape() && (!bIgnoreSameFilledShape || bIgnoreSameFilledShape && boardSlotForPosition.FilledShape != this.FilledShape)) { gameShape = boardSlotForPosition.FilledShape; } } return(gameShape); }