Enumeration iter; Coords coords; int turns; String substr;   if ( null == entity ) { throw new IllegalArgumentException( "The entity is null." ); } if ( null == out ) { throw new IllegalArgumentException( "The writer is null." ); }   out.write( "<entity chassis=\"" ); out.write( entity.getChassis() ); out.write( "\" model=\"" ); out.write( entity.getModel() ); out.write( "\" type=\"" ); out.write( entity.getMovementTypeAsString() ); out.write( "\" techBase=\"" ); out.write( entity.isClan() ? "Clan" : "IS" ); out.write( "\" year=\"" ); out.write( entity.getYear() ); out.write( "\" mass=\"" ); out.write( Float.toString(entity.getWeight()) ); out.write( "\" walkMp=\"" ); out.write( entity.getOriginalWalkMP() ); out.write( "\" jumpMp=\"" ); out.write( entity.getOriginalJumpMP() ); out.write( "\">" );   final Pilot crew = entity.getCrew(); out.write( "<pilot name=\"" ); out.write( crew.getName() ); out.write( "\" gunnery=\"" ); out.write( String.valueOf(crew.getGunnery()) ); out.write( "\" piloting=\"" ); out.write( String.valueOf(crew.getPiloting()) ); if ( crew.isDead() || crew.getHits() > 5 ) { out.write( "\" hits=\"Dead" ); } else if ( crew.getHits() > 0 ) { out.write( "\" hits=\"" ); out.write( String.valueOf(crew.getHits()) ); } if ( crew.countAdvantages() > 0 ) { out.write( "\" advantages=\"" ); out.write( String.valueOf(crew.getAdvantageList(" ")) ); } out.write( "\"/>" );   out.write( "<entityData gameId=\"" ); out.write( entity.getId() ); out.write( "\" externalId=\"" ); out.write( entity.getExternalId() ); out.write( "\" ownerId=\"" ); out.write( entity.getOwnerId() ); out.write( "\" facing=\"" ); out.write( entity.getFacing() ); out.write( "\" secondaryFacing=\"" ); out.write( entity.getSecondaryFacing() ); out.write( "\" walkMpCurrent=\"" ); out.write( entity.getWalkMP() ); out.write( "\" isOmni=\"" ); out.write( entity.isOmni() ? "true" : "false" ); out.write( "\" jumpMpCurrent=\"" ); out.write( entity.getJumpMP() ); out.write( "\" C3MasterId=\"" ); out.write( entity.getC3MasterId() ); out.write( "\" transportId=\"" ); out.write( entity.getTransportId() ); out.write( "\" swarmTargetId=\"" ); out.write( entity.getSwarmTargetId() ); out.write( "\" swarmAttackerId=\"" ); out.write( entity.getSwarmAttackerId() ); out.write( "\" removalCondition=\"" ); out.write( entity.getRemovalCondition() ); out.write( "\" deployRound=\"" ); out.write( entity.getDeployRound() );  out.write( "\" isShutDown=\"" ); out.write( entity.isShutDown() ? "true" : "false" ); out.write( "\" isDoomed=\"" ); out.write( entity.isDoomed() ? "true" : "false" ); out.write( "\" isDestroyed=\"" ); out.write( entity.isDestroyed() ? "true" : "false" ); out.write( "\" isDone=\"" ); out.write( entity.isDone() ? "true" : "false" ); out.write( "\" isProne=\"" ); out.write( entity.isProne() ? "true" : "false" ); out.write( "\" isFindingClub=\"" ); out.write( entity.isFindingClub() ? "true" : "false" ); out.write( "\" isArmsFlipped=\"" ); out.write( entity.getArmsFlipped() ? "true" : "false" ); out.write( "\" isUnjammingRAC=\"" ); out.write( entity.isUnjammingRAC() ? "true" : "false" ); out.write( "\" isSpotting=\"" ); out.write( entity.isSpotting() ? "true" : "false" ); out.write( "\" isClearingMinefield=\"" ); out.write( entity.isClearingMinefield() ? "true" : "false" ); out.write( "\" isSelected=\"" ); out.write( entity.isSelected() ? "true" : "false" ); out.write( "\" isSalvage=\"" ); out.write( entity.isSalvage() ? "true" : "false" ); out.write( "\" isDeployed=\"" ); out.write( entity.isDeployed() ? "true" : "false" );   out.write( "\" heat=\"" ); out.write( entity.heat ); out.write( "\" heatBuildup=\"" ); out.write( entity.heatBuildup ); out.write( "\" delta_distance=\"" ); out.write( entity.delta_distance ); out.write( "\" mpUsed=\"" ); out.write( entity.mpUsed ); out.write( "\" moved=\"" ); out.write( entity.moved ); out.write( "\" damageThisPhase=\"" ); out.write( entity.damageThisPhase ); out.write( "\" engineHitsThisRound=\"" ); out.write( entity.engineHitsThisRound ); out.write( "\" rolledForEngineExplosion=\"" ); out.write( entity.rolledForEngineExplosion ? "true" : "false" ); out.write( "\" dodging=\"" ); out.write( entity.dodging ? "true" : "false" ); out.write( "\" >" );   coords = entity.getPosition(); if ( null != coords ) { CoordsEncoder.encode( coords, out ); }   if ( entity.hasDisplacementAttack() ) { EntityActionEncoder.encode( entity.getDisplacementAttack(), out ); }   substr = getNarcString( entity ); if ( null != substr ) { out.write( substr ); }   if ( entity.infernos.isStillBurning() ) {  out.write( "<inferno>" ); turns = entity.infernos.getArrowIVTurnsLeftToBurn();  if ( turns > 0 ) { out.write( "<arrowiv turns=\"" ); out.write( turns ); out.write( "\" />" ); }  turns -= entity.infernos.getTurnsLeftToBurn(); turns = -turns; if ( turns > 0 ) { out.write( "<standard turns=\"" ); out.write( turns ); out.write( "\" />" ); } out.write( "</inferno>" );     }   out.write( "</entityData>" );     substr = getLocString( entity ); if ( null != substr ) { out.write( substr ); }   out.write( "</entity>" );
    public static void encode( Entity option, Writer out )        throws IOException    {    }