private double calculateTonnage() { if(null == type) { return 0; } //supercharger tonnage will need to be set by hand in parts store if (TechConstants.isClan(type.getTechLevel(campaign.getCalendar().get(GregorianCalendar.YEAR)))) { return Math.round(getUnitTonnage() / 25.0f); } return Math.round(getUnitTonnage() / 20.0f); }
w.write(year + "-" + TechConstants.getTechName(type.getTechLevel(year))); + "-" + TechConstants.getLevelName(type .getTechLevel(year)));
@Override public boolean include(Entry<? extends EquipmentTableModel, ? extends Integer> entry) { EquipmentTableModel eqModel = entry.getModel(); EquipmentType eq = eqModel.getEquipmentTypeAt(entry.getIdentifier()); String currTechClass = TechConstants.getTechName(eq.getTechLevel(gameYear)); boolean techLvlMatch = matchTechLvl(techLevel,eq.getTechLevel(gameYear)); boolean techClassMatch = matchTechClass(techClass,currTechClass); boolean unitTypeMatch = matchUnitType(unitType,eq); if (techLvlMatch && techClassMatch && unitTypeMatch){ return true; }else{ return false; } } };
w.write(year + "-" + TechConstants.getTechName(type.getTechLevel(year))); + "-" + TechConstants.getLevelName(type .getTechLevel(year)));
if ((equipmentType.getTechLevel(year) > tank.getTechLevel()) && (tank.getTechLevel() >= TechConstants.T_IS_ADVANCED)) { boolean isClan = tank.isClan(); if ((equipmentType.getTechLevel(year) == TechConstants.T_IS_EXPERIMENTAL) || (equipmentType.getTechLevel(year) == TechConstants.T_CLAN_EXPERIMENTAL)) { tank.setTechLevel(isClan ? TechConstants.T_CLAN_EXPERIMENTAL : TechConstants.T_IS_EXPERIMENTAL); } else if ((equipmentType.getTechLevel(year) == TechConstants.T_IS_UNOFFICIAL) || (equipmentType.getTechLevel(year) == TechConstants.T_CLAN_UNOFFICIAL)) { tank.setTechLevel(isClan ? TechConstants.T_CLAN_UNOFFICIAL : TechConstants.T_IS_UNOFFICIAL); if ((equipmentType.getTechLevel(year) == TechConstants.T_CLAN_TW) || (equipmentType.getTechLevel(year) == TechConstants.T_CLAN_ADVANCED)) { artEq = EquipmentType.get("CL" + artemis); } else {
public Object getValueAt(int row, int col) { if (row >= equipment.size()) { return null; } EquipmentType eq = equipment.elementAt(row); switch (col) { case COL_QTY: return qty[row] + ""; case COL_NAME: return eq.getName(); case COL_IS_CLAN: return TechConstants.getTechName(eq.getTechLevel(gameYear)); case COL_COST: return eq.getRawCost(); case COL_LEVEL: return TechConstants.getSimpleLevelName(TechConstants .convertFromNormalToSimple(eq .getTechLevel(gameYear))); case COL_INTERNAL_NAME: return eq.getInternalName(); default: return "?"; } }
if (TechConstants.getTechName(etype.getTechLevel(year)).equals( "Inner Sphere")) heatSinkIsClanTechBase = false; else if (TechConstants.getTechName(etype.getTechLevel(year)) .equals("Clan")) heatSinkIsClanTechBase = true;
public void setStructureType(String strucType) { if (!(strucType.startsWith("Clan ") || strucType.startsWith("IS "))) { strucType = isClan() ? "Clan " + strucType : "IS " + strucType; } EquipmentType et = EquipmentType.get(strucType); setStructureType(EquipmentType.getStructureType(et)); if (et == null) { structureTechLevel = TechConstants.T_TECH_UNKNOWN; } else { structureTechLevel = et.getTechLevel(year); // TODO: Is this needed? WTF is the point of it? if (et.getCriticals(this) == 0) { try { this.addEquipment(et, LOC_NONE); } catch (LocationFullException e) { // can't happen e.printStackTrace(); } } } recalculateTechAdvancement(); }
if ((at.getRackSize() == wt.getRackSize()) && at.isLegal(mounted.getEntity().getTechLevelYear(), mounted.getType().getTechLevel(mounted.getEntity().getTechLevelYear()), mounted.getEntity().isMixedTech())) { return at; if ((at.getRackSize() == wt.getRackSize()) && (TechConstants.isLegal( mounted.getType().getTechLevel(3071), at .getTechLevel(3071), false, mounted .getEntity().isMixedTech()))) {
e.isClan(), e.isMixedTech())) { System.out.println(String.format("Ammo %s (TL %d) is not legal for year %d (TL %d)", //$NON-NLS-1$ newAmmoType.getName(), newAmmoType.getTechLevel(year), year, TechConstants.getGameTechLevel(game, e.isClan()))); return null;
if ((equipment.getTechLevel(year) > mech.getTechLevel()) && (mech.getTechLevel() >= TechConstants.T_IS_ADVANCED)) { boolean isClan = mech.isClan(); if ((equipment.getTechLevel(year) == TechConstants.T_IS_EXPERIMENTAL) || (equipment.getTechLevel(year) == TechConstants.T_CLAN_EXPERIMENTAL)) { mech.setTechLevel(isClan ? TechConstants.T_CLAN_EXPERIMENTAL : TechConstants.T_IS_EXPERIMENTAL); } else if ((equipment.getTechLevel(year) == TechConstants.T_IS_UNOFFICIAL) || (equipment.getTechLevel(year) == TechConstants.T_CLAN_UNOFFICIAL)) { mech.setTechLevel(isClan ? TechConstants.T_CLAN_UNOFFICIAL : TechConstants.T_IS_UNOFFICIAL);