public Match3BoardPiece SpawnBoardPiece(int rowIdx, int colIdx, System.Type pieceType, bool autoDestroyOldRef = true)
    {
        Match3BoardPiece boardPiece = (Instantiate(piecesDictionary[pieceType].gameObject) as GameObject).GetComponent <Match3BoardPiece>();

        boardPiece.cachedTransform.position = Vector3.zero;

        boardPiece.name = string.Format("[{0},{1}] {2}", rowIdx, colIdx, boardPiece.name);
        boardPiece.InitComponent(this);

        Match3BoardPiece oldBoardPiece = Board[rowIdx, colIdx] as Match3BoardPiece;

        // If there is already a board piece GameObject instantiated in this slot, destroy it first.
        if (oldBoardPiece != null && autoDestroyOldRef)
        {
            Destroy(oldBoardPiece.gameObject);
        }

        Board[rowIdx, colIdx] = boardPiece;

        return(boardPiece);
    }