/** Let the computer player take its turn. */ public void computerPlay() { computerArea.setName("Thinking!"); computerArea.paintImmediately(computerArea.getVisibleRect()); int minLength = myBoardSize == 4 ? 3 : 4; computerPlayer.findAllValidWords(myBoard, myLexicon, minLength); computerArea.setName("Computer"); for (String s : computerPlayer) { computerArea.showWord(s, myFinder.cellsForWord(myBoard, s), computerPlayer); } myBoardPanel.unHighlightAllDice(); // leave board unhighlighted when // done }
private void initPlayers(IAutoPlayer compPlayer) { computerPlayer = compPlayer; computerPlayer.setView(computerArea); humanPlayer = new HumanPlayer("Human"); humanPlayer.setView(humanArea); }