}
private String getWeapons(boolean showDetail) {
StringBuffer sWeapons = new StringBuffer();
for (Mounted mounted : entity.getWeaponList()) {
WeaponType wtype = (WeaponType) mounted.getType();
sWeapons.append(mounted.getDesc()).append(" [") //$NON-NLS-1$
.append(entity.getLocationAbbr(mounted.getLocation()));
if (mounted.isSplit()) {
sWeapons.append("/") // $NON-NLS-1$
.append(
entity.getLocationAbbr(mounted
.getSecondLocation()));
}
sWeapons.append("]"); //$NON-NLS-1$
if (entity.isClan()
&& mounted.getType().getInternalName().substring(0, 2)
.equals("IS")) { //$NON-NLS-1$
sWeapons.append(Messages.getString("MechView.IS")); //$NON-NLS-1$
}
if (!entity.isClan()
&& mounted.getType().getInternalName().substring(0, 2)
.equals("CL")) { //$NON-NLS-1$
sWeapons.append(Messages.getString("MechView.Clan")); //$NON-NLS-1$
}
if (wtype.hasFlag(WeaponType.F_ONESHOT)) {
sWeapons.append(" <") //$NON-NLS-1$
.append(mounted.getLinked().getDesc()).append(">"); //$NON-NLS-1$
}
if(wtype instanceof BayWeapon) {
//loop through weapons in bay and add up heat
int heat = 0;
for(int wId : mounted.getBayWeapons()) {
Mounted m = entity.getEquipment(wId);
if(null == m) {
continue;
}
heat = heat + ((WeaponType)m.getType()).getHeat();
}
sWeapons.append(" ").append(heat).append(Messages.getString("MechView.Heat")); //$NON-NLS-1$ //$NON-NLS-2$
} else {
sWeapons.append(" ").append(wtype.getHeat()).append(Messages.getString("MechView.Heat")); //$NON-NLS-1$ //$NON-NLS-2$
}
sWeapons.append("\n"); //$NON-NLS-1$
// if this is a weapon bay, then cycle through weapons and ammo
if((wtype instanceof BayWeapon) && showDetail) {
for(int wId : mounted.getBayWeapons()) {
Mounted m = entity.getEquipment(wId);
if(null == m) {
continue;
}
WeaponType newwtype = (WeaponType)m.getType();
sWeapons.append(" ")
.append( m.getDesc() );
if (entity.isClan() &&
m.getType().getInternalName().substring(0,2).equals("IS")) { //$NON-NLS-1$
sWeapons.append(Messages.getString("MechView.IS")); //$NON-NLS-1$
}
if (!entity.isClan() &&
m.getType().getInternalName().substring(0,2).equals("CL")) { //$NON-NLS-1$
sWeapons.append(Messages.getString("MechView.Clan")); //$NON-NLS-1$
}
if (newwtype.hasFlag(WeaponType.F_ONESHOT)) {
sWeapons.append(" <") //$NON-NLS-1$
.append(mounted.getLinked().getDesc())
.append(">"); //$NON-NLS-1$
}