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 gui.components.JokerPanel.JokerTypes;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
|
@ -14,14 +16,27 @@ public abstract class Player {
|
|||
private Color color;
|
||||
private int points;
|
||||
private int remainingTroops;
|
||||
|
||||
private JokerTypes[] jokers;
|
||||
|
||||
protected Player(String name, Color color) {
|
||||
this.name = name;
|
||||
this.points = 0;
|
||||
this.color = color;
|
||||
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
|
||||
* @param playerType The type of player (human, AI, etc.)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue