public static Entity decode( ParsedXML node, Game game ) {
public static Entity decode( ParsedXML node, IGame game ) {
    public static Entity decode( ParsedXML node, Game game ) {        BattleArmor entity = null;        String attrStr;        int attrVal;        // Did we get a null node?        if ( null == node ) {            throw new IllegalArgumentException( "The BattleArmor node is null." );        }        // Make sure that the node is for an BattleArmor unit.        attrStr = node.getAttribute( "name" );        if ( !node.getName().equals( "class" ) ||             null == attrStr || !attrStr.equals( "BattleArmor" ) ) {            throw new IllegalStateException( "Not passed an BattleArmor node." );        }        // TODO : perform version checking.        // Create the entity.        entity = new BattleArmor();        // Walk the board node's children.        Enumeration children = node.elements();        while ( children.hasMoreElements() ) {            ParsedXML child = (ParsedXML) children.nextElement();            String childName = child.getName();            // Handle null child names.            if ( null == childName ) {                // No-op.            }            // Did we find the BV node?            else if ( childName.equals( "bv" ) ) {                // Get the Proto's BV.                attrStr = child.getAttribute( "value" );                if ( null == attrStr ) {                    throw new IllegalStateException                        ( "Couldn't decode the BV for a Protomech unit." );                }                // Try to pull the number from the attribute string                try {                    attrVal = Integer.parseInt( attrStr );                }                catch ( NumberFormatException exp ) {                    throw new IllegalStateException                        ( "Couldn't get an integer from " + attrStr );                }                entity.setBattleValue( attrVal );            }            // Did we find the shootingStrength node?            else if ( childName.equals( "shootingStrength" ) ) {                // Get the number of men shooting.                attrStr = child.getAttribute( "value" );                if ( null == attrStr ) {                    throw new IllegalStateException                        ( "Couldn't decode the shootingStrength for an BattleArmor unit." );                }                // Try to pull the number from the attribute string                try {                    attrVal = Integer.parseInt( attrStr );                }                catch ( NumberFormatException exp ) {                    throw new IllegalStateException                        ( "Couldn't get an integer from " + attrStr );                }                /* Shooting strength is set... oddly. */                // Calculate the number of troopers who can't shoot.                attrVal = entity.locations() - attrVal - 1;                // Initialize the internals, then mark off the non-shooting                // troopers (work last to first); the  EntityEncoder will                // override these values to the actual values.                entity.autoSetInternal();                for ( int loop = 1; loop <= attrVal; loop++ ) {                    entity.setInternal( Entity.ARMOR_NA,                                        entity.locations() - loop );                }                // Now apply the damage.                entity.applyDamage();            }        } // Handle the next element.        // Return the entity.        return entity;    }