<?xml version="1.0"?>
<AllExportData>
	<ExportData>
		<Class>ImageSequence</Class>
		<Name>ImageSequence_ExportToXML</Name>
		<Comment></Comment>
		<Script>// Input is a Collection named:  imageSequenceCollection
// the Collection consists of instances of: ImageSequenceData


// all strings go thru this in order to be compliant with XML
String xml(String s)
{
	return csa.util.UtilityString.toXML(s);
}

/* Template &quot;style&quot; is not supported in BeanShell! */
/* Iterator&lt;ImageSequenceData> iter = imageSequenceCollection.iterator(); */
Iterator iter = imageSequenceCollection.iterator();

// out is defined by the environment 
// out is a String
// all you put to &quot;out&quot; is displayed in output area
// errors are also displayed
out =&quot;&quot;;

boolean first=true;
String tab = &quot;\t&quot;;
String xmlString = &quot;&quot;;
xmlString += &quot;&lt;IMAGEDATA_CLASS>\n&quot;;
while (iter.hasNext()) 
{
	tab = &quot;\t&quot;;
	ImageSequenceData data = (ImageSequenceData) iter.next();
	if (first)
	{
		xmlString += tab+&quot;&lt;IMAGEDATA_CLASS_NAME>&quot;+ xml(data.getCClass())+&quot;&lt;/IMAGEDATA_CLASS_NAME>\n&quot;;
		first=false;
	}
	xmlString += tab+ &quot;&lt;IMAGEDATA_SEQUENCE>\n&quot;;
	tab = &quot;\t\t&quot;;
	xmlString += tab+ &quot;&lt;IMAGE_NAME>&quot; +  xml(data.getName()) + &quot;&lt;/IMAGE_NAME>\n&quot;;
	xmlString += tab+ &quot;&lt;IMAGE_DELAY>&quot; + data.getDelay() + &quot;&lt;/IMAGE_DELAY>\n&quot;;
	xmlString += tab+ &quot;&lt;IMAGE_ORIGIN>&quot; + xml(data.getOriginNotice()) + &quot;&lt;/IMAGE_ORIGIN>\n&quot;;
	xmlString += tab+ &quot;&lt;IMAGE_RANDOM_ANIM>&quot; + data.getRandomAnimationStart() + &quot;&lt;/IMAGE_RANDOM_ANIM>\n&quot;;

	for (int i=0; i&lt; data.getImageSourceFile().size(); i++)
	{
		tab = &quot;\t\t&quot;;
		xmlString += tab+ &quot;&lt;SINGLE_IMAGE_DATA>\n&quot; ;
		tab = &quot;\t\t\t&quot;;
		xmlString += tab+ &quot;&lt;POSITION>&quot; + data.getPosition().elementAt(i) + &quot;&lt;/POSITION>\n&quot;;
		xmlString += tab+ &quot;&lt;SOURCE_FILE>&quot; +  xml(data.getImageSourceFile().elementAt(i)) + &quot;&lt;/SOURCE_FILE>\n&quot;;
		xmlString += tab+ &quot;&lt;IMAGE_X>&quot; + data.getXPos().elementAt(i) + &quot;&lt;/IMAGE_X>\n&quot;;
		xmlString += tab+ &quot;&lt;IMAGE_Y>&quot; + data.getYPos().elementAt(i) + &quot;&lt;/IMAGE_Y>\n&quot;;
		xmlString += tab+ &quot;&lt;IMAGE_WIDTH>&quot; + data.getWidth().elementAt(i) + &quot;&lt;/IMAGE_WIDTH>\n&quot;;
		xmlString += tab+ &quot;&lt;IMAGE_HEIGHT>&quot; + data.getHeight().elementAt(i) + &quot;&lt;/IMAGE_HEIGHT>\n&quot;;
		if (data.getCropXPos().size()>i)
		{
			xmlString += tab+ &quot;&lt;IMAGE_CROP_X>&quot; + data.getCropXPos().elementAt(i) + &quot;&lt;/IMAGE_CROP_X>\n&quot;;
			xmlString += tab+ &quot;&lt;IMAGE_CROP_Y>&quot; + data.getCropYPos().elementAt(i) + &quot;&lt;/IMAGE_CROP_Y>\n&quot;;
			xmlString += tab+ &quot;&lt;IMAGE_CROP_WIDTH>&quot; + data.getCropWidth().elementAt(i) + &quot;&lt;/IMAGE_CROP_WIDTH>\n&quot;;
			xmlString += tab+ &quot;&lt;IMAGE_CROP_HEIGHT>&quot; + data.getCropHeight().elementAt(i) + &quot;&lt;/IMAGE_CROP_HEIGHT>\n&quot;;
			xmlString += tab+ &quot;&lt;IMAGE_OPTIMIZED_CROP_OFFSET_X>&quot; + data.getoptimzeCropOffsetX().elementAt(i) + &quot;&lt;/IMAGE_OPTIMIZED_CROP_OFFSET_X>\n&quot;;
			xmlString += tab+ &quot;&lt;IMAGE_OPTIMIZED_CROP_OFFSET_Y>&quot; + data.getoptimzeCropOffsetY().elementAt(i) + &quot;&lt;/IMAGE_OPTIMIZED_CROP_OFFSET_Y>\n&quot;;
		}
		tab = &quot;\t\t&quot;;
		xmlString += tab+ &quot;&lt;/SINGLE_IMAGE_DATA>\n&quot; ;
	}
	tab = &quot;\t&quot;;

	xmlString += tab + &quot;&lt;/IMAGEDATA_SEQUENCE>\n&quot;;
}
xmlString += &quot;&lt;/IMAGEDATA_CLASS>\n&quot;;

out += xmlString;

// Saving data to a file is left as an exercise for the reader!

</Script>
	</ExportData>
	<ExportData>
		<Class>TileCollection</Class>
		<Name>Tiles_ExportToXML</Name>
		<Comment>Test</Comment>
		<Script>
// Input is a Collection named:  tileDataCollection
// the Collection consists of instances of: TileData


// all strings go thru this in order to be compliant with XML
String xml(String s)
{
	return csa.util.UtilityString.toXML(s);
}

/* Template &quot;style&quot; is not supported in BeanShell! */
/* Iterator&lt;TileData> iter = tileDataCollection.iterator(); */
Iterator iter = tileDataCollection.iterator();

// out is defined by the environment 
// out is a String
// all you put to &quot;out&quot; is displayed in output area
// errors are also displayed
out =&quot;&quot;;

boolean first=true;
String tab = &quot;\t&quot;;
String xmlString = &quot;&quot;;
xmlString += &quot;&lt;TILEDATA_CLASS>\n&quot;;
while (iter.hasNext()) 
{
	tab = &quot;\t&quot;;
	TileData data = (TileData) iter.next();
	if (first)
	{
		xmlString += tab+&quot;&lt;TILEDATA_CLASS_NAME>&quot;+ xml(data.getCClass())+&quot;&lt;/TILEDATA_CLASS_NAME>\n&quot;;
		first=false;
	}
	xmlString += tab+ &quot;&lt;TILEDATA>\n&quot;;
	tab = &quot;\t\t&quot;;
	xmlString += tab+ &quot;&lt;NAME>&quot; +  xml(data.getName()) + &quot;&lt;/NAME>\n&quot;;
	xmlString += tab+ &quot;&lt;WIDTH>&quot; + data.getWidth() + &quot;&lt;/WIDTH>\n&quot;;
	xmlString += tab+ &quot;&lt;HEIGHT>&quot; + data.getHeight() + &quot;&lt;/HEIGHT>\n&quot;;
	xmlString += tab+ &quot;&lt;TYPE>&quot; + data.getType() + &quot;&lt;/TYPE>\n&quot;;
	xmlString += tab+ &quot;&lt;ID>&quot; + data.getID() + &quot;&lt;/ID>\n&quot;;
	xmlString += tab+ &quot;&lt;DESCRIPTION>&quot; + xml(data.getDescription()) + &quot;&lt;/DESCRIPTION>\n&quot;;
	xmlString += tab+ &quot;&lt;IMAGE_FILE>&quot; + xml(data.getImageDataFile()) + &quot;&lt;/IMAGE_FILE>\n&quot;;
	xmlString += tab+ &quot;&lt;IMAGE_NAME>&quot; + xml( data.getImageDataName()) + &quot;&lt;/IMAGE_NAME>\n&quot;;
	xmlString += tab+ &quot;&lt;TILESET_FILENAME>&quot; + xml(data.getTileSetFileName()) + &quot;&lt;/TILESET_FILENAME>\n&quot;;
	xmlString += tab+ &quot;&lt;FORCE_TILE_SIZE>&quot; + data.getForceTileSize() + &quot;&lt;/FORCE_TILE_SIZE>\n&quot;;
	xmlString += tab+ &quot;&lt;FORCE_ACTION_LOOP>&quot; + data.getTileActionLoop() + &quot;&lt;/FORCE_ACTION_LOOP>\n&quot;;
	xmlString += tab+ &quot;&lt;TILE_ACTION_CAN_BE_BROKEN>&quot; + data.getTileActionCanBeBroken() + &quot;&lt;/TILE_ACTION_CAN_BE_BROKEN>\n&quot;;
	xmlString += tab+ &quot;&lt;ACTION_SOUND>&quot; + xml(data.getTileActionSound()) + &quot;&lt;/ACTION_SOUND>\n&quot;;

	xmlString += tab+ &quot;&lt;ATTRIBUTES>\n&quot;;
	for (int i=0; i&lt; data.getAtrributeName().size(); i++)
	{
		tab = &quot;\t\t\t&quot;;
		xmlString += tab+ &quot;&lt;ATTRIBUTE>\n&quot; ;
		tab = &quot;\t\t\t\t&quot;;

		xmlString += tab+ &quot;&lt;ATTIRBUTE_NAME>&quot; + xml(data.getAtrributeName().elementAt(i)) + &quot;&lt;/ATTIRBUTE_NAME>\n&quot;;
		xmlString += tab+ &quot;&lt;ATTIRBUTE_TYPEUTE_NAME>&quot; +  xml(data.getAttributeType().elementAt(i)) + &quot;&lt;/ATTIRBUTE_TYPE>\n&quot;;
		xmlString += tab+ &quot;&lt;ATTIRBUTE_VALUE>&quot; + xml(data.getAttributeValue().elementAt(i)) + &quot;&lt;/ATTIRBUTE_VALUE>\n&quot;;

		tab = &quot;\t\t\t&quot;;
		xmlString += tab+ &quot;&lt;/ATTRIBUTE>\n&quot; ;
	}
	tab = &quot;\t\t&quot;;
	xmlString += tab+ &quot;&lt;/ATTRIBUTES>\n&quot;;
	xmlString += tab+ &quot;&lt;ACTIONS>\n&quot;;
	for (int i=0; i&lt; data.getTileActionIDs().size(); i++)
	{
		tab = &quot;\t\t\t&quot;;
		xmlString += tab+ &quot;&lt;ACTION>\n&quot; ;
		tab = &quot;\t\t\t\t&quot;;

		xmlString += tab+ &quot;&lt;ACTION_ID>&quot; +  xml(data.getTileActionIDs().elementAt(i)) + &quot;&lt;/ACTION_ID>\n&quot;;
		xmlString += tab+ &quot;&lt;ACTION_TILE>&quot; +  xml(data.getTileActionTiles().elementAt(i)) + &quot;&lt;/ACTION_TILE>\n&quot;;

		tab = &quot;\t\t\t&quot;;
		xmlString += tab+ &quot;&lt;/ACTION>\n&quot; ;
	}
	tab = &quot;\t\t&quot;;
	xmlString += tab+ &quot;&lt;/ACTIONS>\n&quot;;
	tab = &quot;\t&quot;;

	xmlString += tab + &quot;&lt;/TILEDATA>\n&quot;;
}
xmlString += &quot;&lt;/TILEDATA_CLASS>\n&quot;;

out += xmlString;

// Saving data to a file is left as an exercise for the reader!

</Script>
	</ExportData>
	<ExportData>
		<Class></Class>
		<Name>ImportReinerAnims</Name>
		<Comment></Comment>
		<Script>import java.util.*;
import java.io.File;

// here imageSourceEdit is an instance of tada! ImageSourceEdit
ImageSourceEdit ise = imageSourceEdit;
// imports all kinds of animations done by Reiner 
        

// helper function to build filesnames of images
    File[] getFiles(String baseDir, String action, String direction)
    {
        Vector vFiles = new Vector();
    
        String fileName = baseDir/*+File.separator*/+action+&quot; &quot;+direction;
        if (action.length()==0)
             fileName = baseDir/*+File.separator*/+direction;
        int counter = -1;
        String stringCounter=&quot;&quot;;
        
        File f = new File(&quot;&quot;);
        do
        {
            counter++;
            stringCounter =  ise.stringformat( &quot;%04d&quot;, counter ) ;
            if (direction.length()==0) stringCounter=&quot;&quot;;
            String fName = fileName.trim()+ stringCounter;
            fName+=&quot;.bmp&quot;;
            f = new File(fName);
System.out.print(&quot;Testing Filename:&quot; +fName);            
            if (f.exists())
            {
                vFiles.addElement(f);
System.out.println(&quot; -> found&quot;);            
            }
else System.out.println(&quot; -> not found&quot;);            
            if (stringCounter.length()==0) break;
                
        }
        while (f.exists());
        return vFiles.toArray(new File[0]);
    }


       
       // in these Subdirs under &quot;images/Chars&quot;
       // the animations will be sought
       String[] filesDirs={
            &quot;axestan shield 96x bitmaps&quot;,
            /*
            &quot;barbar bitmaps&quot;,
            &quot;barbarian king bitmaps&quot;,
            &quot;bat bitmaps&quot;,
            &quot;black mage bitmaps 96x96&quot;,
            &quot;black ninja sword bitmaps&quot;,
            &quot;blackknight battlefield bitmaps&quot;,
            &quot;blue archer bitmaps 96x96&quot;,
            &quot;blueknight battlefield bitmaps&quot;,
            &quot;brown wolf bitmaps&quot;,
            &quot;caveman 96 bitmaps&quot;,
            &quot;caveman club 96 bitmaps&quot;,
            &quot;chicken 45 bitmaps&quot;,
            &quot;cow blacknwhite bitmaps&quot;,
            &quot;dark dwarf 96x bitmaps&quot;,
            &quot;dark princess 96x bitmaps&quot;,
            &quot;deer 96x bitmaps&quot;,
            &quot;devil bitmaps&quot;,
            &quot;dino green bitmaps&quot;,
            &quot;dino red bitmaps&quot;,
            &quot;donkey bitmaps&quot;,
            &quot;elsa bitmaps&quot;,
            &quot;fairy bitmaps&quot;,
            &quot;firedragon bitmaps ground&quot;,
            &quot;floating skull bitmaps&quot;,
            &quot;floating skull dark bitmaps&quot;,
            &quot;floating skull green bitmaps&quot;,
            &quot;flying soul blonde bitmaps&quot;,
            &quot;flying soul brown bitmaps&quot;,
            &quot;freya axe bitmaps&quot;,
            &quot;freya noarms bitmaps&quot;,
            &quot;ghost bitmaps&quot;,
            &quot;green archer bitmaps 96x96&quot;,
            &quot;green dragonfly bitmaps&quot;,
            &quot;green dwarf 96x bitmaps&quot;,
            &quot;green knight battlefield bitmaps&quot;,
            &quot;green swordsman bitmaps&quot;,
            &quot;green zombie bitmaps&quot;,
            &quot;greenGnome&quot;,
            &quot;grey caveman 96X bitmaps&quot;,
            &quot;grey troll bitmaps&quot;,
            &quot;grey wolf  bitmaps&quot;,
            &quot;groggystars bitmaps&quot;,
            &quot;hammerwilly bitmaps&quot;,
            &quot;horseriding knight 144x bitmaps&quot;,
            &quot;hunter 96x bitmaps&quot;,
            &quot;ice troll bitmaps&quot;,
            &quot;john doe bitmaps96x96&quot;,
            &quot;jumping fish bitmaps&quot;,
            &quot;koenig bitmaps&quot;,
            &quot;lavatroll bitmaps&quot;,
            &quot;lilly bitmaps&quot;,
            &quot;lion female 128 bitmaps&quot;,
            &quot;lion male 128 bitmaps&quot;,
            &quot;lionsoul bitmaps&quot;,
            &quot;luzia the witch bitmaps&quot;,
            &quot;luziasheep bitmaps&quot;,
            &quot;magic animations BITMAPS&quot;,
            &quot;magier 45 bitmaps&quot;,
            &quot;mister death working bitmaps&quot;,
            &quot;mummy 45 bitmaps&quot;,
            &quot;mushyman bitmaps&quot;,
            &quot;nobeard bitmaps&quot;,
            &quot;ogre 96x bitmaps&quot;,
            &quot;pink zombie bitmaps&quot;,
            &quot;pirat bitmaps&quot;,
            &quot;piratesailor blue bitmaps&quot;,
            &quot;princess 96x bitmaps&quot;,
            &quot;queen 96x bitmaps&quot;,
            &quot;red archer bitmaps 96x96&quot;,
            &quot;red dragonfly bitmaps&quot;,
            &quot;red knight bitmaps&quot;,
            &quot;red spider bitmaps&quot;,
            &quot;red swordsman bitmaps&quot;,
            &quot;red zombie bitmaps&quot;,
            &quot;redGnome&quot;,
            &quot;schaufelwilly bitmaps&quot;,
            &quot;schwein bitmaps&quot;,
            &quot;sheep bitmaps&quot;,
            &quot;skelette&quot;,
            &quot;soldier bitmaps&quot;,
            &quot;spider bitmaps&quot;,
            &quot;staffstan bitmaps&quot;,
            &quot;stan unarmed  bitmaps&quot;,
            &quot;swampthing bitmaps&quot;,
            &quot;swordskel bitmaps&quot;,
            &quot;swordstan bitmaps&quot;,
            &quot;Swrom&quot;,
            &quot;thief bitmaps96x96&quot;,
            &quot;transportwilly bitmaps&quot;,
            &quot;vlad 96x bitmaps&quot;,
            &quot;vlad axe 96x bitmaps&quot;,
            &quot;vlad sword 96x bitmaps&quot;,
            &quot;wasp96bitmaps&quot;,
            &quot;waterdragon ground bitmaps&quot;,
            &quot;white mage bitmaps 96x96&quot;,
            &quot;willy bitmaps&quot;,
            &quot;yellow archer bitmaps 96x96&quot;,
            &quot;yellow dragonfly bitmaps&quot;
               */
            };
       
       // remove the following passages from dir names -> to build class names
       String[] remove={&quot;bitmaps&quot;, &quot;96x96&quot;, &quot;96x&quot;,&quot;96X&quot;, &quot;96&quot;, &quot;45&quot;, &quot;144x&quot;, &quot;128&quot;};

       // load animations with the following &quot;starters&quot;
       // if not found nothing will be loaded!
       String[] actions = {
            &quot;magic spelling&quot;,
            &quot;magic attack&quot;,
            &quot;magieattack&quot;,
            &quot;attack&quot;,
            &quot;running&quot;, 
            &quot;walking&quot;,
            &quot;schiesst&quot;,
            &quot;spit&quot;,
            &quot;magie&quot;,
            &quot;rennt&quot;,
            &quot;flying&quot;,
            &quot;luft&quot;,
            &quot;fliegt&quot;,
            &quot;shooting&quot;,

            &quot;green dragonfly&quot;,
            &quot;red dragonfly&quot;,
            &quot;yellow dragonfly&quot;, 

            &quot;biting&quot;,
            &quot;walk&quot;,
            &quot;pick up&quot;,
            &quot;stealing&quot;,
            &quot;throwing&quot;,
            &quot;wurmhaufen&quot;,
            &quot;wurm stirbt&quot;,
            &quot;wurm steigt&quot;,
            &quot;wurm erscheint&quot;,
            &quot;kriecht&quot;,
            &quot;strickt&quot;,
            &quot;macht faxen&quot;,
            &quot;frisst&quot;,
            &quot;digging&quot;,
            &quot;greeting&quot;,
            &quot;scythe unequip&quot;,
            &quot;equip&quot;,
            &quot;sits&quot;,
            &quot;jumping fish&quot;,
            &quot;pickup&quot;,
            &quot;laydown&quot;,
            &quot;headshaking&quot;,
            &quot;building&quot;,
            &quot;bows&quot;,
            &quot;heult&quot;,
            &quot;treffer&quot;,
            &quot;disintegrate&quot;,
            &quot;spricht&quot;,
            &quot;disappear&quot;,
            &quot;sitzt hin&quot;,
            &quot;skull stand up&quot;,
            &quot;stand up&quot;,
            &quot;floating&quot;,
            &quot;sleeps&quot;,
            &quot;liest&quot;,
            &quot;labert&quot;,
            &quot;roaring&quot;,
            &quot;appearing&quot;,
            &quot;knit&quot;,
            &quot;looking&quot;,
            &quot;muuuh&quot;,
            &quot;eating&quot;,
            &quot;picking&quot;,
            &quot;howling&quot;,
            &quot;stands up&quot;,
            &quot;sits down&quot;,
            &quot;swordunequip&quot;,
            &quot;swordequip&quot;,
            &quot;been hit&quot;, 
            
            &quot;talking&quot;,
            &quot;tipping over&quot;, 
            &quot;kippt um&quot;,
            &quot;paused&quot;, 
            &quot;highflying&quot;,
            &quot;stopped&quot;, 
            &quot;vladmorphtobat&quot;, 
            &quot;stopped0000&quot;,
            &quot;stopped0001&quot;,
            &quot;stopped0002&quot;,
            &quot;stopped0003&quot;,
            &quot;stopped0004&quot;,
            &quot;stopped0005&quot;,
            &quot;stopped0006&quot;,
            &quot;stopped0007&quot;,
            &quot;&quot;
               
       };
       
       // following directions for each animation will be loaded
       String[] dirs = {&quot;e&quot;, &quot;w&quot;, &quot;s&quot;, &quot;n&quot;, &quot;ne&quot;, &quot;nw&quot;, &quot;se&quot;, &quot;sw&quot;, &quot;stopped&quot;, &quot;steht&quot;, &quot;groggy&quot;, &quot;liosoul&quot;,&quot;stirbt&quot;,&quot;aus&quot;,&quot;moving&quot;, &quot;&quot;};
       
       // all animations are counted from 0000 up to xxxx whenever a corresponding file ist not found
       
       // ensure usage of file sizes, since all animation parts are in single bmp files
       ise.setUseFileSizes(true);
       ise.setReplaceSequenceDataOnSameName(true);
        
        // base directory
        String base=&quot;.&quot;+File.separator+&quot;images&quot;+File.separator+&quot;Chars&quot;;
        for (int d = 0; d &lt; filesDirs.length; d++) 
        {
            String klasse = filesDirs[d];
            for (int r=0; r &lt;remove.length; r++ )
            {
                klasse = csa.util.UtilityString.replace(klasse, remove[r], &quot;&quot;);
            }

            // a new class name!
            klasse = csa.util.UtilityString.replace(klasse.trim(), &quot; &quot;, &quot;_&quot;);
            ise.setFilename(klasse); // all classes in single files, otherwise files grows TO Big (> 20MB)
            ise.setKlasse(klasse);

            String baseAnimName = klasse;
            String directory = base+File.separator;

            // directory to look for images 
            directory += filesDirs[d]+File.separator;
            
            // go thru all directions
            for (int a = 0; a &lt; actions.length; a++) 
            {
                // go thru all actions
                String action = actions[a];
                for (int i = 0; i &lt; dirs.length; i++) 
                {
                    String direction = dirs[i];
                   //Clear
                    ise.clearImages();

                    // get all files in that directory with given action and direction
                    File[] files = getFiles(directory, action, direction);
                    
                    // if nothing found - go on
                    if (files.length &lt;=0) continue;
            

                    // add all files to current sequence
                    ise.addMultipleImages(files);

                    // set the base name for the images
		ise.setImageSequenceName(baseAnimName+&quot;_&quot;+action+&quot;_&quot;+direction);
                    // add
                    // save all images as one animtion
                    ise.addAsAnimation();    

                    
                    String filename = &quot;AllReinersCharAnimations&quot;+File.separator+baseAnimName+&quot;_&quot;+action+&quot;_&quot;+direction;
                    ise.saveAnimationAsOneImage(filename);
                    ise.addAsAnimation();    

                    // reset
                    ise.resetCache();
                    
                    // get color to alpha channel
                    // set that color to be non opaque (alpha == 0
		ise.setColorToBackgroundAt(4+98,4);                    
                    // save as the same image
                    ise.saveColoredImageAsSelf();
                }
            }
        }</Script>
	</ExportData>
	<ExportData>
		<Class>Map</Class>
		<Name>Map_ExportToXML</Name>
		<Comment></Comment>
		<Script>// Input is a TMap named:  map

// all strings go thru this in order to be compliant with XML
String xml(String s)
{
	return csa.util.UtilityString.toXML(s);
}

/* Template &quot;style&quot; is not supported in BeanShell! */

// out is defined by the environment 
// out is a String
// all you put to &quot;out&quot; is displayed in output area
// errors are also displayed
out =&quot;&quot;;

boolean first=true;
String tab = &quot;\t&quot;;
String xmlString = &quot;&quot;;
xmlString += &quot;&lt;MAP_CLASS>\n&quot;;
xmlString += tab+&quot;&lt;CLASS_NAME>&quot;+ xml(map.getData().getCClass())+&quot;&lt;/CLASS_NAME>\n&quot;;
xmlString += tab+&quot;&lt;MAP_NAME>&quot;+ xml(map.getData().getName())+&quot;&lt;/MAP_NAME>\n&quot;;
xmlString += tab+ &quot;&lt;WIDTH>&quot; + map.getData().getSizeX() + &quot;&lt;/WIDTH>\n&quot;;
xmlString += tab+ &quot;&lt;HEIGHT>&quot; + map.getData().getSizeY() + &quot;&lt;/HEIGHT>\n&quot;;
xmlString += tab+ &quot;&lt;SIZE_BY_TILES>&quot; + map.getData().getSizeByTiles() + &quot;&lt;/SIZE_BY_TILES>\n&quot;;
xmlString += tab+ &quot;&lt;WRAP_HORIZONTAL>&quot; + map.getData().getWrapHorizontal() + &quot;&lt;/WRAP_HORIZONTAL>\n&quot;;
xmlString += tab+ &quot;&lt;WRAP_VERTICAL>&quot; + map.getData().getWrapVertical() + &quot;&lt;/WRAP_VERTICAL>\n&quot;;
xmlString += tab+ &quot;&lt;ALLOW_TILE_OVERLAY>&quot; + map.getData().getAllowTileOverlap() + &quot;&lt;/ALLOW_TILE_OVERLAY>\n&quot;;
xmlString += tab+ &quot;&lt;SIZE_PER_LAYER>&quot; + map.getData().getsizePerLayer() + &quot;&lt;/SIZE_PER_LAYER>\n&quot;;


xmlString += tab+ &quot;&lt;LAYERS>\n&quot;;

for (int i=0; i&lt; map.getCurrentLayers().size(); i++)
{
	tab = &quot;\t\t&quot;;
	xmlString += tab+ &quot;&lt;LAYER>\n&quot;;
	Layer layer = (Layer) map.getCurrentLayers().get(i);
	LayerData ldata = layer.getData();
	tab = &quot;\t\t\t&quot;;
	xmlString += tab+&quot;&lt;LAYER_CLASS_NAME>&quot;+ xml(ldata.getCClass())+&quot;&lt;/LAYER_CLASS_NAME>\n&quot;;
	xmlString += tab+&quot;&lt;LAYER_NAME>&quot;+ xml(ldata.getName())+&quot;&lt;/LAYER_NAME>\n&quot;;
	xmlString += tab+&quot;&lt;PURPOSE_TYPE>&quot;+ xml(ldata.getpurposeTyp())+&quot;&lt;/PURPOSE_TYPE>\n&quot;;
	xmlString += tab+&quot;&lt;SCROLL_BEHAVIOUR>&quot;+ xml(ldata.getscrollBehaviour())+&quot;&lt;/SCROLL_BEHAVIOUR>\n&quot;;

	xmlString += tab+ &quot;&lt;VERTICAL_SPEED>&quot; +ldata.getverticalSpeed() + &quot;&lt;/VERTICAL_SPEED>\n&quot;;
	xmlString += tab+ &quot;&lt;HORIZONTAL_SPEED>&quot; + ldata.gethorizontalSpeed() + &quot;&lt;/HORIZONTAL_SPEED>\n&quot;;
	xmlString += tab+ &quot;&lt;MUST_BE_PAINTED>&quot; +ldata.getmustBePainted() + &quot;&lt;/MUST_BE_PAINTED>\n&quot;;
	xmlString += tab+ &quot;&lt;IS_BACKGROUND_COLLISION>&quot; +ldata.getisBackgroundCollision() + &quot;&lt;/IS_BACKGROUND_COLLISION>\n&quot;;
	xmlString += tab+ &quot;&lt;IS_FOREGROUND_COLLISION>&quot; + ldata.getisForgroundCollision() + &quot;&lt;/IS_FOREGROUND_COLLISION>\n&quot;;
	xmlString += tab+ &quot;&lt;IS_CHANGABLE>&quot; +ldata.getisChangeable() + &quot;&lt;/IS_CHANGABLE>\n&quot;;
	xmlString += tab+ &quot;&lt;BACKGROUND_COLOR>&quot; + ldata.getbackgroundColor() + &quot;&lt;/BACKGROUND_COLOR>\n&quot;;
	xmlString += tab+ &quot;&lt;LAYER_ORDER_NUMBER>&quot; + ldata.getLayerNumber() + &quot;&lt;/LAYER_ORDER_NUMBER>\n&quot;;
	xmlString += tab+ &quot;&lt;IS_BACKGROUND>&quot; + ldata.getisBackground() + &quot;&lt;/IS_BACKGROUND>\n&quot;;
	xmlString += tab+ &quot;&lt;IS_VISIBLE>&quot; + ldata.getisVisible() + &quot;&lt;/IS_VISIBLE>\n&quot;;
	xmlString += tab+ &quot;&lt;ALLOW_TILEOVERLAY>&quot; +ldata.getallowTileOverlap() + &quot;&lt;/ALLOW_TILEOVERLAY>\n&quot;;

	xmlString += tab+ &quot;&lt;TILES>\n&quot;;
	for (int t=0; t&lt;ldata.gettileX().size(); t++)
	{
		tab = &quot;\t\t\t\t&quot;;
		xmlString += tab+ &quot;&lt;TILE>\n&quot;;
		tab = &quot;\t\t\t\t\t&quot;;

		xmlString += tab+ &quot;&lt;TILE_NAME>&quot; + xml(ldata.gettileName().elementAt(t)) + &quot;&lt;/TILE_NAME>\n&quot;;
		xmlString += tab+ &quot;&lt;TILE_COLLECTION>&quot; + xml(ldata.getusedTileCollection().elementAt(t)) + &quot;&lt;/TILE_COLLECTION>\n&quot;;
		xmlString += tab+ &quot;&lt;TILE_X>&quot; + ldata.gettileX().elementAt(t) + &quot;&lt;/TILE_X>\n&quot;;
		xmlString += tab+ &quot;&lt;TILE_Y>&quot; + ldata.gettileY().elementAt(t) + &quot;&lt;/TILE_Y>\n&quot;;


		tab = &quot;\t\t\t\t&quot;;
		xmlString += tab+ &quot;&lt;/TILE>\n&quot;;
	}
	tab = &quot;\t\t\t&quot;;
	xmlString += tab+ &quot;&lt;/TILES>\n&quot;;


	tab = &quot;\t\t&quot;;
	xmlString += tab+ &quot;&lt;/LAYER>\n&quot;;
}
String tab = &quot;\t&quot;;
xmlString += tab+ &quot;&lt;/LAYERS>\n&quot;;
xmlString += &quot;&lt;/MAP_CLASS>\n&quot;;
out += xmlString;

// Saving data to a file is left as an exercise for the reader!

</Script>
	</ExportData>
</AllExportData>
