@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(Integer.toString(unit.getBV())); w.write(","); w.write(Long.toString(unit.getCost())); w.write(","); w.write(Long.toString(unit.getUnloadedCost()));
return ""; return formatter.format(Math.ceil(o.unit.getCost() * o.pct / 100.0));
shipSearchExpiration.add(Calendar.DAY_OF_MONTH, 31); report.append(shipSearchResult).append(" is available for purchase for ") .append(NumberFormat.getInstance().format(ms.getCost())).append(" C-bills until ") .append(df.format(shipSearchExpiration.getTime())); } else {
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; }
panButtons.add(button); button.addActionListener(ev -> purchase()); button.setEnabled(ms != null && gui.getCampaign().getFunds() >= ms.getCost());
campaign.calculatePartTransitTime(Compute.d6(2) - 2); UnitMarket.MarketOffer offer = marketModel.getOffer(tableUnits.convertRowIndexToModel(tableUnits.getSelectedRow())); long cost = (long)Math.ceil(offer.unit.getCost() * offer.pct / 100.0); if (campaign.getFunds() < cost) { campaign.addReport("<font color='red'><b> You cannot afford this unit. Transaction cancelled</b>.</font>");
long cost = ms.getCost(); if (getFunds() < cost) { addReport("<font color='red'><b> You cannot afford this unit. Transaction cancelled</b>.</font>");
return ms.getCost();