use of megamek.common.TechAdvancement in project megameklab by MegaMek.
the class SpecializationView method filterSpecializations.
private void filterSpecializations() {
RowFilter<SpecializationModel, Integer> filter = new RowFilter<SpecializationModel, Integer>() {
@Override
public boolean include(Entry<? extends SpecializationModel, ? extends Integer> entry) {
SpecializationModel specModel = entry.getModel();
TechAdvancement techAdvancement = specModel.getTechAdvancement(entry.getIdentifier());
if ((1 << entry.getIdentifier() == Infantry.TAG_TROOPS) && TestInfantry.maxSecondaryWeapons(getInfantry()) < 2) {
return false;
}
return (null != eSource.getTechManager()) && eSource.getTechManager().isLegal(techAdvancement);
}
};
sorter.setRowFilter(filter);
}
use of megamek.common.TechAdvancement in project megameklab by MegaMek.
the class CISpecializationView method filterSpecializations.
private void filterSpecializations() {
RowFilter<SpecializationModel, Integer> filter = new RowFilter<SpecializationModel, Integer>() {
@Override
public boolean include(Entry<? extends SpecializationModel, ? extends Integer> entry) {
SpecializationModel specModel = entry.getModel();
TechAdvancement techAdvancement = specModel.getTechAdvancement(entry.getIdentifier());
if ((1 << entry.getIdentifier() == Infantry.TAG_TROOPS) && TestInfantry.maxSecondaryWeapons(getInfantry()) < 2) {
return false;
}
return (null != eSource.getTechManager()) && eSource.getTechManager().isLegal(techAdvancement);
}
};
sorter.setRowFilter(filter);
}
Aggregations