From a3a1da1d9afcd7dd8d139397d4e4ac7916b5b24b Mon Sep 17 00:00:00 2001 From: Malte Tammena Date: Fri, 20 Oct 2017 14:21:54 +0200 Subject: [PATCH] Added enemyID functionality --- src/game/Game.java | 3 +++ src/game/PlayerObject.java | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/game/Game.java b/src/game/Game.java index d6da950..b8afb8b 100644 --- a/src/game/Game.java +++ b/src/game/Game.java @@ -68,6 +68,9 @@ public class Game { this.hist = new GameHistory(); this.board = new int [GAME_COLUMNS][GAME_ROWS]; this.gameOn = false; + // Set enemy IDs + this.p1.setEnemyID(2); + this.p2.setEnemyID(1); } /** diff --git a/src/game/PlayerObject.java b/src/game/PlayerObject.java index 52c4be1..dc657d7 100644 --- a/src/game/PlayerObject.java +++ b/src/game/PlayerObject.java @@ -11,6 +11,7 @@ public class PlayerObject { private final Player p; private final int id; + private int enemyID; private String sym; /** @@ -37,6 +38,11 @@ public class PlayerObject { return this.p; } + public void setEnemyID(int id) { + this.enemyID = id; + this.p.setEnemyID(id); + } + public int getID() { return this.id; }