public static boolean isTechMatch(MechSummary mech, int nTechType) { return ((nTechType == TechConstants.T_ALL) || (nTechType == mech.getType()) || ((nTechType == TechConstants.T_IS_TW_ALL) && ((mech.getType() <= TechConstants.T_IS_TW_NON_BOX) || (mech.getType() == TechConstants.T_INTRO_BOXSET))) || ((nTechType == TechConstants.T_TW_ALL) && ((mech.getType() <= TechConstants.T_IS_TW_NON_BOX) || (mech.getType() <= TechConstants.T_INTRO_BOXSET) || (mech.getType() <= TechConstants.T_CLAN_TW))) || ((nTechType == TechConstants.T_ALL_IS) && ((mech.getType() <= TechConstants.T_IS_TW_NON_BOX) || (mech.getType() == TechConstants.T_INTRO_BOXSET) || (mech.getType() == TechConstants.T_IS_ADVANCED) || (mech.getType() == TechConstants.T_IS_EXPERIMENTAL) || (mech.getType() == TechConstants.T_IS_UNOFFICIAL))) || ((nTechType == TechConstants.T_ALL_CLAN) && ((mech.getType() == TechConstants.T_CLAN_TW) || (mech.getType() == TechConstants.T_CLAN_ADVANCED) || (mech.getType() == TechConstants.T_CLAN_EXPERIMENTAL) || (mech.getType() == TechConstants.T_CLAN_UNOFFICIAL)))); }
w.write(","); w.write(TechConstants.getLevelDisplayableName(unit .getType())); w.write(","); w.write(Double.toString(unit.getTons()));
ArrayList<MechSummary> allBA = new ArrayList<MechSummary>(); for (MechSummary m : all) { if ((p.tech != TechConstants.T_ALL) && (p.tech != m.getType())) { if (m.getType() != TechConstants.T_CLAN_TW) { continue; if ((m.getType() != TechConstants.T_INTRO_BOXSET) && (m.getType() != TechConstants.T_IS_TW_NON_BOX)) { continue; if (m.getType() != TechConstants.T_INTRO_BOXSET) { continue; if ((m.getType() != TechConstants.T_INTRO_BOXSET) && (m.getType() != TechConstants.T_IS_TW_NON_BOX) && (m.getType() != TechConstants.T_CLAN_TW)) { continue; if ((m.getType() != TechConstants.T_INTRO_BOXSET) && (m.getType() != TechConstants.T_IS_TW_NON_BOX)) { continue; if ((m.getType() != TechConstants.T_INTRO_BOXSET) && (m.getType() != TechConstants.T_IS_TW_NON_BOX) && (m.getType() != TechConstants.T_IS_ADVANCED) && (m.getType() != TechConstants.T_IS_EXPERIMENTAL) && (m.getType() != TechConstants.T_IS_UNOFFICIAL)) { continue;
private long getPurchasePrice(MechSummary ms) { long cost = ms.getCost(); if(ms.getUnitType().equals(UnitType.getTypeName(UnitType.INFANTRY)) || ms.getUnitType().equals(UnitType.getTypeName(UnitType.BATTLE_ARMOR))) { cost = ms.getAlternateCost(); } if(TechConstants.isClan(ms.getType())) { cost *= campaign.getCampaignOptions().getClanPriceModifier(); } return cost; }
@Override public boolean include(Entry<? extends MechTableModel, ? extends Integer> entry) { MechTableModel mechModel = entry.getModel(); MechSummary mech = mechModel.getMechSummary(entry.getIdentifier()); ITechnology tech = UnitTechProgression.getProgression(mech, campaign.getTechFaction(), true); if ( /*year limits*/ (!campaign.getCampaignOptions().limitByYear() || mech.getYear() <= year) && /*Clan/IS limits*/ (campaign.getCampaignOptions().allowClanPurchases() || !TechConstants.isClan(mech.getType())) && (campaign.getCampaignOptions().allowISPurchases() || TechConstants.isClan(mech.getType())) && /* Canon */ (mech.isCanon() || !campaign.getCampaignOptions().allowCanonOnly()) && /* Weight */ (mech.getWeightClass() == nClass || nClass == EntityWeightClass.SIZE) && /* Technology Level */ (null != tech) && campaign.isLegal(tech) && /*Unit type*/ (nUnit == UnitType.SIZE || mech.getUnitType().equals(UnitType.getTypeName(nUnit))) && (searchFilter==null || MechSearchFilter.isMatch(mech, searchFilter))) { if(txtFilter.getText().length() > 0) { String text = txtFilter.getText(); return mech.getName().toLowerCase().contains(text.toLowerCase()); } return true; } return false; } };