Update Player.java
This commit is contained in:
parent
af331170a8
commit
82e8c32465
1 changed files with 15 additions and 0 deletions
|
|
@ -2,6 +2,8 @@ package game;
|
||||||
|
|
||||||
import game.map.Castle;
|
import game.map.Castle;
|
||||||
|
|
||||||
|
import gui.components.JokerPanel.JokerTypes;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
|
@ -15,13 +17,26 @@ public abstract class Player {
|
||||||
private int points;
|
private int points;
|
||||||
private int remainingTroops;
|
private int remainingTroops;
|
||||||
|
|
||||||
|
private JokerTypes[] jokers;
|
||||||
|
|
||||||
protected Player(String name, Color color) {
|
protected Player(String name, Color color) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.points = 0;
|
this.points = 0;
|
||||||
this.color = color;
|
this.color = color;
|
||||||
this.remainingTroops = 0;
|
this.remainingTroops = 0;
|
||||||
|
|
||||||
|
jokers = new JokerTypes[]{JokerTypes.ADD_TROOPS, JokerTypes.SCARE_TROOPS};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JokerTypes[] getJokers() {
|
||||||
|
return jokers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJoker(int index, JokerTypes joker) {
|
||||||
|
jokers[index] = joker;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a player
|
* Creates a player
|
||||||
* @param playerType The type of player (human, AI, etc.)
|
* @param playerType The type of player (human, AI, etc.)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue