From f42de527a2f275b75985b4cd0a3f77c234a5d2d3 Mon Sep 17 00:00:00 2001 From: Steffen Helmke Date: Mon, 17 Jan 2022 21:41:43 +0100 Subject: [PATCH] 4gewinnt: added setter/getter for player2Score --- src/main/java/de/tims/viergewinnt/ai/Logic.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/de/tims/viergewinnt/ai/Logic.java b/src/main/java/de/tims/viergewinnt/ai/Logic.java index 1f643c8..9112de2 100644 --- a/src/main/java/de/tims/viergewinnt/ai/Logic.java +++ b/src/main/java/de/tims/viergewinnt/ai/Logic.java @@ -16,6 +16,7 @@ public class Logic { private int[][] board = new int[6][6]; private int currentPlayer = 1; private int player1Score = 0; + private int player2Score = 0; public void setField(int player, int row, int column) { board[row][column] = player; @@ -41,6 +42,14 @@ public class Logic { return player1Score; } + public void setPlayer2Score(int score) { + player2Score = score; + } + + public int getPlayer2Score() { + return player2Score; + } + public int playChip(int column) { //add board update