double expectedDmg = odds * getExpectedDamage((WeaponType)mw.getType());
double expectedDmg;   if ( en instanceof Infantry ) {   Infantry inf = (Infantry) en; expectedDmg = inf.getDamage(inf.getShootingStrength()); } else {  expectedDmg = getExpectedDamage((WeaponType)mw.getType()); }   if ( e instanceof Infantry ) { Hex e_hex = game.getBoard().getHex( e.getPosition() ); if ( !e_hex.contains(Terrain.WOODS) && !e_hex.contains(Terrain.BUILDING) ) { expectedDmg *= 2; } }   expectedDmg = odds * expectedDmg;
     protected FiringOption calculateOneWeaponDamagePotential(int from, Mounted mw)     {         // for now assume I'm facing front         Entity en = game.getEntity(from);                 int weaponID = en.getEquipmentNum(mw);                    // for each target I could attack        // which has the highest expected damage?        Entity bestTarget = null;        double bestValue = 0;        Enumeration ents = game.getEntities();        while (ents.hasMoreElements()) {            Entity e = (Entity)ents.nextElement();            if (e.getOwner().isEnemyOf(game.getPlayer(this.local_pn))) {                ToHitData th = Compute.toHitWeapon(game, from, game.getEntityID(e), weaponID, new Vector(0));                    if (th.getValue() != ToHitData.IMPOSSIBLE) {                    double odds = Compute.oddsAbove(th.getValue())/ 100.0;                    double expectedDmg = odds * getExpectedDamage((WeaponType)mw.getType());                    if (expectedDmg > bestValue) {                        bestTarget = e;                        bestValue = expectedDmg;                    }                }            }        }        if (bestTarget == null) return null;        return new FiringOption(bestTarget, bestValue, mw);     }