Browse Source

4gewinnt: refactored setter and getter

4gewinnt
Steffen Helmke 3 years ago
committed by Lorenz Hohmann
parent
commit
caf11d2ee2
  1. 16
      src/main/java/de/tims/viergewinnt/ai/Logic.java

16
src/main/java/de/tims/viergewinnt/ai/Logic.java

@ -23,11 +23,11 @@ public class Logic {
} }
public void setField(int player, int row, int column) { public void setField(int player, int row, int column) {
board[row][column] = player;
this.board[row][column] = player;
} }
public int getField(int row, int column) { public int getField(int row, int column) {
return board[row][column];
return this.board[row][column];
} }
public int getBoardSize() { public int getBoardSize() {
@ -35,27 +35,27 @@ public class Logic {
} }
public void setCurrentPlayer(int player) { public void setCurrentPlayer(int player) {
currentPlayer = player;
this.currentPlayer = player;
} }
public int getCurrentPlayer() { public int getCurrentPlayer() {
return currentPlayer;
return this.currentPlayer;
} }
public void setPlayer1Score(int score) { public void setPlayer1Score(int score) {
player1Score = score;
this.player1Score = score;
} }
public int getPlayer1Score() { public int getPlayer1Score() {
return player1Score;
return this.player1Score;
} }
public void setPlayer2Score(int score) { public void setPlayer2Score(int score) {
player2Score = score;
this.player2Score = score;
} }
public int getPlayer2Score() { public int getPlayer2Score() {
return player2Score;
return this.player2Score;
} }
public int playChip(int column) { public int playChip(int column) {

Loading…
Cancel
Save