final IHex curHex = game.board.getHex( coords );
final IHex curHex = game.getBoard().getHex( coords );
    private boolean checkForCollapse( Building bldg, Hashtable positionMap ) {        // If the input is meaningless, do nothing and throw no exception.        if ( bldg == null ||             positionMap == null || positionMap.isEmpty() ) {            return false;        }        // Get the building's current CF.        final int currentCF = bldg.getCurrentCF();        // Track all units that fall into the building's basement by Coords.        Hashtable basementMap = new Hashtable();        // Walk through the hexes in the building, looking for a collapse.        Enumeration bldgCoords = bldg.getCoords();        boolean collapse = false;        while ( !collapse && bldgCoords.hasMoreElements() ) {            final Coords coords = (Coords) bldgCoords.nextElement();            // Get the Vector of Entities at these coordinates.            final Vector vector = (Vector) positionMap.get( coords );            // Are there any Entities at these coords?            if ( vector != null ) {                // How many levels does this building have in this hex?                final IHex curHex = game.board.getHex( coords );                final int hexElev = curHex.surface();                final int numFloors = curHex.terrainLevel( Terrains.BLDG_ELEV );                // Track the load of each floor (and of the roof) separately.                // Track all units that fall into the basement in this hex.                // N.B. don't track the ground floor, the first floor is at                // index 0, the second is at index 1, etc., and the roof is                // at index (numFloors-1).                int[] loads = new int[numFloors];                Vector basement = new Vector();                for ( int loop = 0; loop < numFloors; loop++ ) {                    loads[loop] = 0;                }                // Walk through the entities in this position.                Enumeration entities = vector.elements();                while ( !collapse && entities.hasMoreElements() ) {                    final Entity entity = (Entity) entities.nextElement();                    final int entityElev = entity.elevationOccupied( curHex );                    // Ignore entities not *inside* the building                    if ( !Compute.isInBuilding( game, entity, coords ) ) {                        continue;                    }                    // Add the weight of a Mek or tank to the correct floor.                    if ( entity instanceof Mech || entity instanceof Tank ) {                        int load = (int) entity.getWeight();                        int floor = entityElev - hexElev;                        // Entities on the ground floor may fall into the                        // basement, but they won't collapse the building.                        if ( floor == 0 && load > currentCF ) {                            basement.addElement( entity );                        } else if ( floor > 0 ) {                            // If the load on any floor but the ground floor                            // exceeds the building's current CF it collapses.                            floor--;                            loads[ floor ] += load;                            if ( loads[ floor ] > currentCF ) {                                collapse = true;                            }                        } // End not-ground-floor                    } // End increase-load                } // Handle the next entity.                // Track all entities that fell into the basement.                if ( !basement.isEmpty() ) {                    basementMap.put( coords, basement );                }            } // End have-entities-here        } // Check the next hex of the building.        // Collapse the building if the flag is set.        if ( collapse ) {            phaseReport.append( bldg.getName() )                .append( " collapses due to heavy loads!\n" );            this.collapseBuilding( bldg, positionMap );        }        // Otherwise, did any entities fall into the basement?        else if ( !basementMap.isEmpty() ) {            // TODO: implement basements        }        // Return true if the building collapsed.        return collapse;    } // End private boolean checkForCollapse( Building, Hashtable )