|
@@ -8,9 +8,10 @@ import java.util.Set;
|
|
|
import java.util.SortedSet;
|
|
import java.util.SortedSet;
|
|
|
import java.util.TreeSet;
|
|
import java.util.TreeSet;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
+import java.util.stream.Stream;
|
|
|
|
|
|
|
|
import org.leumasjaffe.charsheet.model.features.DDFeat;
|
|
import org.leumasjaffe.charsheet.model.features.DDFeat;
|
|
|
-import org.leumasjaffe.charsheet.model.features.DDFeature;
|
|
|
|
|
|
|
+import org.leumasjaffe.charsheet.model.features.DDProperty;
|
|
|
import org.leumasjaffe.charsheet.model.inventory.DDInventory;
|
|
import org.leumasjaffe.charsheet.model.inventory.DDInventory;
|
|
|
import org.leumasjaffe.charsheet.model.observable.IntValue;
|
|
import org.leumasjaffe.charsheet.model.observable.IntValue;
|
|
|
import org.leumasjaffe.charsheet.model.observable.ObjectValue;
|
|
import org.leumasjaffe.charsheet.model.observable.ObjectValue;
|
|
@@ -97,8 +98,10 @@ public class DDCharacter extends Observable {
|
|
|
return classes.stream().map(DDCharacterClass::getLevel).mapToInt(IntValue::value).sum();
|
|
return classes.stream().map(DDCharacterClass::getLevel).mapToInt(IntValue::value).sum();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public List<DDFeature> getFeatureBonuses(String appliesScope) {
|
|
|
|
|
- return feats.stream().flatMap(f -> f.getProperties().stream())
|
|
|
|
|
- .filter(f -> f.appliesTo(appliesScope)).collect(Collectors.toList());
|
|
|
|
|
|
|
+ public List<DDProperty> getFeatureBonuses(String appliesScope) {
|
|
|
|
|
+ return Stream.concat(feats.stream().flatMap(f -> f.getProperties().stream())
|
|
|
|
|
+ .filter(f -> f.appliesTo(appliesScope)),
|
|
|
|
|
+ classes.stream().flatMap(cl -> cl.getFeatureBonuses(appliesScope).stream()))
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|