chapter_004_Multithreading/src/main/java/testtask/Hero.java
public void placeOnBoard() {
        boolean placeIsDone = false;
        while (!placeIsDone) {
            this.x = (int) (Math.random() * game.board.length);
            this.y = (int) (Math.random() * game.board[0].length);
            if (!game.board[x][y].isLocked()) {
                this.locker = game.board[x][y];
                this.locker.lock();
                break;
            }
        }
    }
/**
     * Place current hero on board.
     */
Place current hero on board.
Place current hero on board .
public void placeOnBoard() {
        boolean placeIsDone = false;
        while (!placeIsDone) {
            this.x = (int) (Math.random() * game.board.length);
            this.y = (int) (Math.random() * game.board[0].length);
            if (!game.board[x][y].isLocked()) {
                this.locker = game.board[x][y];
                this.locker.lock();
                break;
            }
        }
    }
public void placeOnBoard ( ) { boolean placeIsDone = false ; while ( ! placeIsDone ) { this . x = ( int ) ( Math . random ( ) * game . board . length ) ; this . y = ( int ) ( Math . random ( ) * game . board [ 0 ] . length ) ; if ( ! game . board [ x ] [ y ] . isLocked ( ) ) { this . locker = game . board [ x ] [ y ] ; this . locker . lock ( ) ; break ; } } }
Place current hero on board.
Place current hero on board .