Add visualizing of flag castles

This commit is contained in:
joachimschmidt557 2019-03-25 13:28:42 +01:00
parent 7f14dc6a42
commit 745b86a8f3
3 changed files with 49 additions and 1 deletions

View file

@ -53,6 +53,14 @@ public class Game {
this.goal = goal;
this.goal.setGame(this);
}
/**
* Gets the current goal
* @return The current goal
*/
public Goal getGoal() {
return this.goal;
}
/**
* The round this game is currently in

View file

@ -89,6 +89,12 @@ public class CaptureTheFlagGoal extends Goal {
}
public boolean isFlagCastle(Castle castle) {
return flagCastles.contains(castle);
}
/**
* Distribute the flag castles evenly to
* all players
@ -133,7 +139,7 @@ public class CaptureTheFlagGoal extends Goal {
private List<Castle> pickRandomCastles(List<Castle> castles, int num) {
int min = 0;
int max = castles.size();
int max = castles.size() - 1;
List<Integer> nums = new ArrayList<Integer>();