protected void addEquipment(Mounted mounted, int loc, boolean rearMounted) throws LocationFullException { mounted.setLocation(loc, rearMounted); equipmentList.addElement(mounted);   if (mounted.getType() instanceof WeaponType) { weaponList.addElement(mounted); if(mounted.getType().hasFlag(WeaponType.F_ARTILLERY)) { aTracker.addWeapon(mounted); }  if (mounted.getType().hasFlag(WeaponType.F_ONESHOT)) { Mounted m = new Mounted(this, AmmoType.getOneshotAmmo(mounted)); m.setShotsLeft(1); mounted.setLinked(m);   addEquipment(m, Entity.LOC_NONE, false); } } if (mounted.getType() instanceof AmmoType) { ammoList.addElement(mounted); } if (mounted.getType() instanceof MiscType) { miscList.addElement(mounted); }
public Mounted addEquipment(EquipmentType etype, int loc) throws LocationFullException { return addEquipment(etype, loc, false);
    protected void addEquipment(Mounted mounted, int loc, boolean rearMounted)        throws LocationFullException    {        mounted.setLocation(loc, rearMounted);        equipmentList.addElement(mounted);        // add it to the proper sub-list        if (mounted.getType() instanceof WeaponType) {            weaponList.addElement(mounted);            if(mounted.getType().hasFlag(WeaponType.F_ARTILLERY)) {                aTracker.addWeapon(mounted);            }            // one-shot launchers need their single shot of ammo added.            if (mounted.getType().hasFlag(WeaponType.F_ONESHOT)) {                Mounted m = new Mounted(this, AmmoType.getOneshotAmmo(mounted));                m.setShotsLeft(1);                mounted.setLinked(m);                //Oneshot ammo will be identified by having a location                // of null.  Other areas in the code will rely on this.                addEquipment(m, Entity.LOC_NONE, false);            }        }        if (mounted.getType() instanceof AmmoType) {            ammoList.addElement(mounted);        }        if (mounted.getType() instanceof MiscType) {            miscList.addElement(mounted);        }    }