hunt effect added
This commit is contained in:
@@ -1,18 +1,36 @@
|
||||
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Events;
|
||||
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters.Hunter;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventType;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventCard;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Hunt extends EventCard {
|
||||
public Hunt(int Era) {
|
||||
int foodToAdd;
|
||||
int prestigeMoltiplicator;
|
||||
public Hunt(int Era, int foodToAdd, int prestigeMoltiplicator) {
|
||||
super(Era, EventType.HUNT);
|
||||
this.foodToAdd = foodToAdd;
|
||||
this.prestigeMoltiplicator = prestigeMoltiplicator;
|
||||
}
|
||||
|
||||
// TODO
|
||||
@Override
|
||||
public void activateEvent (ArrayList <Player> playerList){
|
||||
for (Player player : playerList) {
|
||||
ArrayList <Character> characterList= player.getCharacterCards();
|
||||
int hunterCounter=0;
|
||||
|
||||
for (Character character : characterList) {
|
||||
if (character instanceof Hunter) {
|
||||
hunterCounter++;
|
||||
}
|
||||
}
|
||||
|
||||
player.addFood(foodToAdd);
|
||||
player.addPrestige(prestigeMoltiplicator * hunterCounter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user