Home | History | Annotate | Download | only in library

Lines Matching refs:player

37     /** Start player. Must be 1 or 2. Default is 1. */

88 State player = mGameView.getCurrentPlayer();
89 if (player == State.UNKNOWN) {
90 player = State.fromInt(getIntent().getIntExtra(EXTRA_START_PLAYER, 1));
91 if (!checkGameFinished(player)) {
92 selectTurn(player);
95 if (player == State.PLAYER2) {
98 if (player == State.WIN) {
104 private State selectTurn(State player) {
105 mGameView.setCurrentPlayer(player);
108 if (player == State.PLAYER1) {
112 } else if (player == State.PLAYER2) {
117 return player;
132 State player = mGameView.getCurrentPlayer();
134 if (player == State.WIN) {
137 } else if (player == State.PLAYER1) {
141 mGameView.setCell(cell, player);
173 private State getOtherPlayer(State player) {
174 return player == State.PLAYER1 ? State.PLAYER2 : State.PLAYER1;
178 State player = mGameView.getCurrentPlayer();
179 if (!checkGameFinished(player)) {
180 player = selectTurn(getOtherPlayer(player));
181 if (player == State.PLAYER2) {
187 public boolean checkGameFinished(State player) {
222 setFinished(player, col, row, diag);
234 private void setFinished(State player, int col, int row, int diagonal) {
237 mGameView.setWinner(player);
241 setWinState(player);
244 private void setWinState(State player) {
250 if (player == State.EMPTY) {
252 } else if (player == State.PLAYER1) {