tank.addEquipment(equipmentType, location);
Mounted weapon = tank.addEquipment(equipmentType, location);     if(artemisType != 0 && equipmentType instanceof WeaponType) { String artemis = null; int ammoType = ((WeaponType)equipmentType).getAmmoType(); if(ammoType == AmmoType.T_LRM) { if((artemisType & 2) == 2) { artemis="ArtemisIV"; } else if((artemisType & 8) == 8) { artemis="ArtemisV"; } } else if(ammoType == AmmoType.T_SRM) { if((artemisType & 1) == 1) { artemis="ArtemisIV"; } else if((artemisType & 4) == 4) { artemis="ArtemisV"; } } if(artemis != null) { EquipmentType artEq; if(equipmentType.getTechLevel() == TechConstants.T_CLAN_LEVEL_2 || equipmentType.getTechLevel() == TechConstants.T_CLAN_LEVEL_3) { artEq = EquipmentType.get("CL"+artemis); } else { artEq = EquipmentType.get("IS"+artemis); } if(artEq != null) { Mounted fcs = tank.addEquipment(artEq, location); fcs.setLinked(weapon); } } }
  private void addEquipment(Tank tank, HMVWeaponLocation weaponLocation,                            int location)    throws Exception  {    Hashtable equipmentAtLocation = (Hashtable) equipment.get(weaponLocation);    if (equipmentAtLocation != null)    {      for (Enumeration e = equipmentAtLocation.keys(); e.hasMoreElements();)      {        EquipmentType equipmentType = (EquipmentType) e.nextElement();        Integer count = (Integer) equipmentAtLocation.get(equipmentType);        for (int i = 0; i < count.intValue(); i++)        {          tank.addEquipment(equipmentType, location);        }      }    }  }