Fix: Sustenence Optimized
This commit is contained in:
@@ -29,17 +29,10 @@ public class Sustenance extends EventCard {
|
|||||||
|
|
||||||
int NCharDiscount = 0;
|
int NCharDiscount = 0;
|
||||||
for(Player p : playerList){
|
for(Player p : playerList){
|
||||||
ArrayList<Character> characters = new ArrayList<>();
|
|
||||||
characters.addAll(p.artists);
|
|
||||||
characters.addAll(p.builders);
|
|
||||||
characters.addAll(p.inventors);
|
|
||||||
characters.addAll(p.gatherers);
|
|
||||||
characters.addAll(p.shamans);
|
|
||||||
characters.addAll(p.hunters);
|
|
||||||
|
|
||||||
for(BuildingCard b : player.getBuildingCards()){
|
for(BuildingCard b : player.getBuildingCards()){
|
||||||
if(b.getEffectId() == 1){
|
if(b.getEffectId() == 1){
|
||||||
NCharDiscount += (int) characters.stream().filter(x -> x.getType().equals(((Building1)b).getIcon())).count();
|
CharacterType c = ((Building1)b).getIcon();
|
||||||
|
NCharDiscount += p.getNType(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package it.polimi.ingsw.gc14.Model;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
class PlayerTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void addFood() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void removeFood() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void addPrestige() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void removePrestige() {
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user