@Override public int compare(MechSummary ms1, MechSummary ms2) { switch (m_nType) { case T_CHASSIS: return ms1.getChassis().compareTo(ms2.getChassis()); case T_MODEL: return ms1.getModel().compareTo(ms2.getModel()); case T_WEIGHT: return Double.compare(ms1.getTons(), ms2.getTons()); case T_BV: return Integer.compare(ms1.getBV(), ms2.getBV()); case T_YEAR: return Integer.compare(ms1.getYear(), ms2.getYear()); case T_COST: return Long.compare(ms1.getCost(), ms2.getCost()); case T_LEVEL: return ms1.getLevel().compareTo(ms2.getLevel()); default: return 0; } } }
w.write(Long.toString(unit.getUnloadedCost())); w.write(","); w.write(Integer.toString(unit.getYear())); w.write(","); w.write(TechConstants.getLevelDisplayableName(unit
public Object getValueAt(int row, int col) { MechSummary ms = data[row]; if(col == COL_MODEL) { return ms.getModel(); } if(col == COL_CHASSIS) { return ms.getChassis(); } if(col == COL_WEIGHT) { return ms.getTons(); } if(col == COL_BV) { return ms.getBV(); } if(col == COL_YEAR) { return ms.getYear(); } if(col == COL_COST) { return formatter.format(getPurchasePrice(ms)); } return "?"; }
(!campaign.getCampaignOptions().limitByYear() || targetYear > ms.getYear()) && (!ms.isClan() || campaign.getCampaignOptions().allowClanPurchases()) && (ms.isClan() || campaign.getCampaignOptions().allowISPurchases());
private void initializeExtraCostsAndTons() { alternateCost = 0; alternateTon = 0; //simplest way to do this is just get the full cost and tonnage of a new unit and divide by //squad size MechSummary summary = MechSummaryCache.getInstance().getMech(getChassis() + " " + getModel()); if(null != summary) { int squadSize = summary.getArmorTypes().length - 1; alternateCost = summary.getAlternateCost()/squadSize; alternateTon = summary.getSuitWeight(); introYear = summary.getYear(); } }
&& !(mech.getYear() > year)) { if(txtFilter.getText().length() > 0) { String text = txtFilter.getText();
@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; } };
mechSummary = ms; unitType = parseUnitType(ms.getUnitType()); introYear = ms.getYear(); if (unitType == UnitType.MEK) {
if (ms.isClan()) { p.setOriginalUnitTech(2); } else if (ms.getYear() > 3050) {
campaign.getCalendar().get(Calendar.YEAR) < ms.getYear()) { continue;
return ms.getYear();