public String getModel() { return mechSummary.getModel(); }
public static void main(String[] args) { Parameters p = new Parameters(); p.mechs = 4; p.tanks = 4; p.infantry = 0; p.ba = 4; p.maxBV = 8000; p.minBV = 7600; p.minYear = 3050; p.maxYear = 3055; p.tech = TechConstants.T_IS_TW_NON_BOX; p.canon = true; p.padWithInfantry = true; ArrayList<MechSummary> units = generateArmy(p); int totalBV = 0; for (MechSummary m : units) { totalBV += m.getBV(); System.out.print(m.getChassis()); System.out.print(" "); System.out.print(m.getModel()); System.out.print(" "); System.out.println(m.getBV()); } System.out.print("Total: "); System.out.println(totalBV); }
private void exportList(int connId, String path) { try { PrintWriter pw1 = new PrintWriter(new FileWriter(path)); MechSummary[] msums = MechSummaryCache.getInstance().getAllMechs(); for (MechSummary ms1 : msums) { pw1.println(ms1.getChassis() + ", " + ms1.getModel() + ", " + ms1.getBV()); } pw1.flush(); pw1.close(); server.sendServerChat(server.getPlayer(connId).getName() + " has exported a unit list."); } catch (Exception e) { server.sendServerChat(connId, "/exportlist: execution failed"); server.sendServerChat(connId, e.toString()); } } }
@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; } } }
"all", MechSummary.determineETypeName(summary)); String specificId = QuirksHandler.getUnitId( summary.getChassis(), summary.getModel(), MechSummary.determineETypeName(summary)); List<Entity> entities;
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 "?"; }
summary.getModel(), ""); String unitIdNoModel = QuirksHandler.getUnitId( summary.getChassis(), "all", "");
private void stockBattleArmorSuits(Campaign c) { //this is just a test for(MechSummary summary : MechSummaryCache.getInstance().getAllMechs()) { if(!summary.getUnitType().equals("BattleArmor")) { continue; } //FIXME: I can't pull entity movement mode and quad shape off of mechsummary //try loading the full entity, but this might take too long if(null != summary) { Entity newEntity = null; try { newEntity = new MechFileParser(summary.getSourceFile(), summary.getEntryName()).getEntity(); } catch (EntityLoadingException e) { e.printStackTrace(); } if(null != newEntity) { BattleArmorSuit ba = new BattleArmorSuit(summary.getChassis(), summary.getModel(), (int)summary.getTons(), 1, summary.getWeightClass(), summary.getWalkMp(), summary.getJumpMp(), newEntity.entityIsQuad(), summary.isClan(), newEntity.getMovementMode(), c); parts.add(ba); } } } }
public ModelRecord(MechSummary ms) { this(ms.getChassis(), ms.getModel()); mechSummary = ms; unitType = parseUnitType(ms.getUnitType());
return ms.getModel();