21 lines
717 B
Java
21 lines
717 B
Java
package de.joethei.monopoly.fields;
|
|
|
|
import de.joethei.monopoly.Monopoly;
|
|
import de.joethei.monopoly.Player;
|
|
import de.joethei.monopoly.action.Action;
|
|
import de.joethei.monopoly.action.ActionType;
|
|
|
|
public class Event extends Field{
|
|
|
|
public Event() {
|
|
super("Ereignisfeld");
|
|
getActions().add(new Action("Karte erhalten und ausführen", this, ActionType.REQUIRED) {
|
|
@Override
|
|
public void execute(Player player) {
|
|
Monopoly.getStatistics().get("eventCards").incrementAndGet();
|
|
int random = Monopoly.getRandom().nextInt(Monopoly.getCards().size());
|
|
Monopoly.getCards().get(random).execute(player);
|
|
}
|
|
});
|
|
}
|
|
} |