Exemplo n.º 1
0
 private static BoardElement GetNewElementForPosition(int collum, int row, BoardManager board, ref bool[, ] searchedElements)
 {
     if (BoardFunctions.GetIfMatchCreatesBell(collum, row, board.elementsPositions, ref searchedElements))
     {
         return(BoardFunctions.CreateNewElement(board.elementsPositions[collum, row], BoardElement.BoardElementTypes.Bell));
     }
     else if (BoardFunctions.GetIfMatchCreatesBomb(collum, row, board.elementsPositions, ref searchedElements))
     {
         return(BoardFunctions.CreateNewElement(board.elementsPositions[collum, row], BoardElement.BoardElementTypes.Bomb));
     }
     else if (BoardFunctions.GetIfMatchCreatesCross(collum, row, board.elementsPositions, ref searchedElements))
     {
         return(BoardFunctions.CreateNewElement(board.elementsPositions[collum, row], BoardElement.BoardElementTypes.Cross));
     }
     else
     {
         int cashElementIndex = BoardFunctions.GetIfCashElement();
         if (cashElementIndex > -1)
         {
             return(BoardFunctions.CreateNewCashElement(board.elementsPositions[collum, row], cashElementIndex));
         }
         else
         {
             return(BoardFunctions.CreateNewElement(board.elementsPositions[collum, row], BoardElement.BoardElementTypes.Default));
         }
     }
 }