Merge branch 'minor-game-change' into 'master'

Added enemyID functionality

See merge request !20
This commit is contained in:
Malte Tammena 2017-10-20 14:23:48 +02:00
commit a0d6033cb7
2 changed files with 9 additions and 0 deletions

View file

@ -68,6 +68,9 @@ public class Game {
this.hist = new GameHistory(); this.hist = new GameHistory();
this.board = new int [GAME_COLUMNS][GAME_ROWS]; this.board = new int [GAME_COLUMNS][GAME_ROWS];
this.gameOn = false; this.gameOn = false;
// Set enemy IDs
this.p1.setEnemyID(2);
this.p2.setEnemyID(1);
} }
/** /**

View file

@ -11,6 +11,7 @@ public class PlayerObject {
private final Player p; private final Player p;
private final int id; private final int id;
private int enemyID;
private String sym; private String sym;
/** /**
@ -37,6 +38,11 @@ public class PlayerObject {
return this.p; return this.p;
} }
public void setEnemyID(int id) {
this.enemyID = id;
this.p.setEnemyID(id);
}
public int getID() { public int getID() {
return this.id; return this.id;
} }