int man; int points; double men_per_point;   this.damage[0] = 0;    if (weapon == INF_RIFLE || weapon == INF_LRM) men_per_point = 4.0; else if (weapon == INF_MG || weapon == INF_FLAMER) men_per_point = 3.0; else if (weapon == INF_LASER || weapon == INF_SRM) men_per_point = 2.0; else throw new IllegalArgumentException( "Unknown infantry weapon: " + weapon );    for ( man = 1, points = 1; man <= INF_PLT_MAX_MEN; man++, points++ ) {   this.damage[man] = (int) Math.ceil( points / men_per_point );   if ( 1 == man && ( INF_MG == weapon || INF_FLAMER == weapon ) ) { points--; }  }   if ( INF_MG == weapon || INF_FLAMER == weapon ) { this.damage[INF_PLT_MAX_MEN] = (int) Math.ceil( INF_PLT_MAX_MEN / men_per_point );
switch(weapon) { case INF_RIFLE: damage = DAMAGE_BALLISTIC_RIFLE; break; case INF_MG: damage = DAMAGE_MACHINE_GUN; break; case INF_FLAMER: damage = DAMAGE_FLAMER; break; case INF_LASER: damage = DAMAGE_ENERGY_RIFLE; break; case INF_SRM: damage = DAMAGE_SRM; break; case INF_LRM: damage = DAMAGE_LRM; break; default: throw new IllegalArgumentException("Unknown infantry weapon");
    private void setDamage( long weapon )    {        int man;        int points; // MGs and Flamers have wierd damage profiles.        double men_per_point;        // The platoon does no damage when its out of men.        this.damage[0] = 0;        // The various weapons require different amounts of        // men to cause additional points of damage.        if (weapon == INF_RIFLE || weapon == INF_LRM)            men_per_point = 4.0;        else if (weapon == INF_MG || weapon == INF_FLAMER)            men_per_point = 3.0;        else if (weapon == INF_LASER || weapon == INF_SRM)            men_per_point = 2.0;        else throw new IllegalArgumentException( "Unknown infantry weapon: " + weapon );        // Loop through the men in the platoon, and assign damage based        // upon the number of men it takes to do a point of damage.        for ( man = 1, points = 1;              man <= INF_PLT_MAX_MEN;               man++, points++ ) {            // Round all fractions up.            this.damage[man] = (int) Math.ceil( points / men_per_point );            // MGs and Flamers do something wierd for the first point of damage            if ( 1 == man && ( INF_MG == weapon || INF_FLAMER == weapon ) ) {                points--;            }        } // Handle the next man in the platoon.        // MGs and Flamers do something wierd for the last point of damage        if ( INF_MG == weapon || INF_FLAMER == weapon ) {            this.damage[INF_PLT_MAX_MEN] =                (int) Math.ceil( INF_PLT_MAX_MEN / men_per_point );        }    } // End private void setDamage( int ) throws Exception