Fix: Hunt, HuntTest
This commit is contained in:
@@ -14,6 +14,7 @@ public class Hunt extends EventCard {
|
|||||||
int prestigeMultiplicator;
|
int prestigeMultiplicator;
|
||||||
public Hunt(int Era, int prestigeMultiplicator) {
|
public Hunt(int Era, int prestigeMultiplicator) {
|
||||||
super(Era, EventType.HUNT);
|
super(Era, EventType.HUNT);
|
||||||
|
this.foodToAdd = 1;
|
||||||
this.prestigeMultiplicator = prestigeMultiplicator;
|
this.prestigeMultiplicator = prestigeMultiplicator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Events;
|
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Events;
|
||||||
|
|
||||||
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters.Hunter;
|
||||||
import it.polimi.ingsw.gc14.Model.Player;
|
import it.polimi.ingsw.gc14.Model.Player;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
@@ -14,33 +15,34 @@ class HuntTest {
|
|||||||
void activateEvent() {
|
void activateEvent() {
|
||||||
Player p1 = new Player("Giacomo");
|
Player p1 = new Player("Giacomo");
|
||||||
Player p2 = new Player("xiaomi");
|
Player p2 = new Player("xiaomi");
|
||||||
Player p3 = new Player("intellij");
|
|
||||||
Player p4 = new Player("mesos");
|
|
||||||
|
|
||||||
|
|
||||||
ArrayList<Player> players = new ArrayList<>(Arrays.asList(p1,p2,p3,p4));
|
ArrayList<Player> players = new ArrayList<>(Arrays.asList(p1,p2));
|
||||||
Hunt h1 = new Hunt(1, 1, 3);
|
Hunt h1 = new Hunt(1, 3);
|
||||||
h1.activateEvent(players);
|
h1.activateEvent(players);
|
||||||
|
|
||||||
assertEquals(0, p1.getPrestigeValue());
|
assertEquals(0, p1.getPrestigeValue());
|
||||||
assertEquals(1, p1.getFoodValue());
|
assertEquals(1, p1.getFoodValue());
|
||||||
assertEquals(0, p2.getPrestigeValue());
|
assertEquals(0, p2.getPrestigeValue());
|
||||||
assertEquals(1, p2.getFoodValue());
|
assertEquals(1, p2.getFoodValue());
|
||||||
assertEquals(0, p3.getPrestigeValue());
|
|
||||||
assertEquals(1, p3.getFoodValue());
|
|
||||||
assertEquals(0, p4.getPrestigeValue());
|
|
||||||
assertEquals(1, p4.getFoodValue());
|
|
||||||
|
|
||||||
Hunt h2 = new Hunt(1, -11, 0);
|
|
||||||
|
Hunt h2 = new Hunt(1, 3);
|
||||||
|
Hunter hunter1 = new Hunter(1, true);
|
||||||
|
Hunter hunter2 = new Hunter(1, false);
|
||||||
|
p1.hunters.add(hunter1);
|
||||||
|
p1.hunters.add(hunter2);
|
||||||
|
|
||||||
|
Hunter hunter3 = new Hunter(1, false);
|
||||||
|
p2.hunters.add(hunter3);
|
||||||
|
|
||||||
h2.activateEvent(players);
|
h2.activateEvent(players);
|
||||||
assertEquals(0, p1.getPrestigeValue());
|
assertEquals(6, p1.getPrestigeValue());
|
||||||
assertEquals(-10, p1.getFoodValue());
|
assertEquals(2, p1.getFoodValue());
|
||||||
assertEquals(0, p2.getPrestigeValue());
|
assertEquals(3, p2.getPrestigeValue());
|
||||||
assertEquals(-10, p2.getFoodValue());
|
assertEquals(3, p2.getPrestigeValue());
|
||||||
assertEquals(0, p3.getPrestigeValue());
|
assertEquals(2, p2.getFoodValue());
|
||||||
assertEquals(-10, p3.getFoodValue());
|
|
||||||
assertEquals(0, p4.getPrestigeValue());
|
|
||||||
assertEquals(-10, p4.getFoodValue());
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user