// Path: src/main/java/de/ailis/wlandsuite/common/exceptions/GameException.java
// public class GameException extends WlandsuiteException
// {
//     /** Serial version UID */
//     private static final long serialVersionUID = -5279351594699018309L;
// 
// 
//     /**
//      * Constructor
//      */
// 
//     public GameException()
//     {
//         super();
//     }
// 
//     /**
//      * Constructor
//      * 
//      * @param message
//      *            The exception message
//      */
// 
//     public GameException(String message)
//     {
//         super(message);
//     }
// 
// 
//     /**
//      * Constructor
//      * 
//      * @param cause
//      *            The root cause
//      */
// 
//     public GameException(Throwable cause)
//     {
//         super(cause);
//     }
// 
// 
//     /**
//      * Constructor
//      * 
//      * @param message
//      *            The exception message
//      * @param cause
//      *            The root cause
//      */
// 
//     public GameException(String message, Throwable cause)
//     {
//         super(message, cause);
//     }
// }
// 
// Path: src/main/java/de/ailis/wlandsuite/utils/XmlUtils.java
// public class XmlUtils
// {
//     /** Tje wlandsuite XML namespace */
//     private static final String namespace = "http://ailis.de/wlandsuite";
// 
// 
//     /**
//      * Returns a new XML element within the wlandsuite namespace.
//      * 
//      * @param name
//      *            The element name
//      * @return The new XML element
//      */
// 
//     public static Element createElement(String name)
//     {
//         return DocumentFactory.getInstance().createElement(name, namespace);
//     }
// 
// 
//     /**
//      * Reads a document from the specified input stream. The XML reader is fully
//      * configured to validate the wlandsuite namespace.
//      * 
//      * @param stream
//      *            The input stream
//      * @return The validated document
//      */
// 
//     public static Document readDocument(InputStream stream)
//     {
//         SAXReader reader;
// 
//         reader = new SAXReader(true);
//         try
//         {
//             reader.setFeature("http://xml.org/sax/features/validation", true);
//             reader.setFeature(
//                 "http://apache.org/xml/features/validation/schema", true);
//             reader
//                 .setFeature(
//                     "http://apache.org/xml/features/validation/schema-full-checking",
//                     true);
//             reader
//                 .setProperty(
//                     "http://apache.org/xml/properties/schema/external-schemaLocation",
//                     "http://ailis.de/wlandsuite classpath://de/ailis/wlandsuite/resource/wlandsuite.xsd");
//             reader.setEntityResolver(ClasspathEntityResolver.getInstance());
//             return reader.read(stream);
//         }
//         catch (SAXException e)
//         {
//             throw new XmlException("Unable to configure XML reader: "
//                 + e.toString(), e);
//         }
//         catch (DocumentException e)
//         {
//             throw new XmlException("Unable to read XML document: "
//                 + e.toString(), e);
//         }
//     }
// }


import org.dom4j.Document;
import org.dom4j.Element;
import de.ailis.wlandsuite.common.exceptions.GameException;
import de.ailis.wlandsuite.game.RotatingXorInputStream;
import de.ailis.wlandsuite.game.RotatingXorOutputStream;
import de.ailis.wlandsuite.game.parts.ShopItem;
import de.ailis.wlandsuite.io.SeekableInputStream;
import de.ailis.wlandsuite.io.SeekableOutputStream;
import de.ailis.wlandsuite.utils.XmlUtils;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
     * Reads an external shop item list file which is used by Displacer's hacked
     * EXE.
     *
     * @param stream
     *            The input stream
     * @return The shop item list
     * @throws IOException
     *             When file operation fails.
     */

    public static ShopItemList readHacked(final InputStream stream)
        throws IOException
    {
        return readData(new SeekableInputStream(stream));
    }


    /**
     * Writes the shop items to the specified output stream.
     *
     * @param stream
     *            The output stream
     * @param disk
     *            The disk id (0 or 1)
     * @throws IOException
     *             When file operation fails.
     */

    public void write(final OutputStream stream, final int disk) throws IOException
    {
// Path: src/main/java/de/ailis/wlandsuite/common/exceptions/GameException.java
// public class GameException extends WlandsuiteException
// {
//     /** Serial version UID */
//     private static final long serialVersionUID = -5279351594699018309L;
// 
// 
//     /**
//      * Constructor
//      */
// 
//     public GameException()
//     {
//         super();
//     }
// 
//     /**
//      * Constructor
//      * 
//      * @param message
//      *            The exception message
//      */
// 
//     public GameException(String message)
//     {
//         super(message);
//     }
// 
// 
//     /**
//      * Constructor
//      * 
//      * @param cause
//      *            The root cause
//      */
// 
//     public GameException(Throwable cause)
//     {
//         super(cause);
//     }
// 
// 
//     /**
//      * Constructor
//      * 
//      * @param message
//      *            The exception message
//      * @param cause
//      *            The root cause
//      */
// 
//     public GameException(String message, Throwable cause)
//     {
//         super(message, cause);
//     }
// }
// 
// Path: src/main/java/de/ailis/wlandsuite/utils/XmlUtils.java
// public class XmlUtils
// {
//     /** Tje wlandsuite XML namespace */
//     private static final String namespace = "http://ailis.de/wlandsuite";
// 
// 
//     /**
//      * Returns a new XML element within the wlandsuite namespace.
//      * 
//      * @param name
//      *            The element name
//      * @return The new XML element
//      */
// 
//     public static Element createElement(String name)
//     {
//         return DocumentFactory.getInstance().createElement(name, namespace);
//     }
// 
// 
//     /**
//      * Reads a document from the specified input stream. The XML reader is fully
//      * configured to validate the wlandsuite namespace.
//      * 
//      * @param stream
//      *            The input stream
//      * @return The validated document
//      */
// 
//     public static Document readDocument(InputStream stream)
//     {
//         SAXReader reader;
// 
//         reader = new SAXReader(true);
//         try
//         {
//             reader.setFeature("http://xml.org/sax/features/validation", true);
//             reader.setFeature(
//                 "http://apache.org/xml/features/validation/schema", true);
//             reader
//                 .setFeature(
//                     "http://apache.org/xml/features/validation/schema-full-checking",
//                     true);
//             reader
//                 .setProperty(
//                     "http://apache.org/xml/properties/schema/external-schemaLocation",
//                     "http://ailis.de/wlandsuite classpath://de/ailis/wlandsuite/resource/wlandsuite.xsd");
//             reader.setEntityResolver(ClasspathEntityResolver.getInstance());
//             return reader.read(stream);
//         }
//         catch (SAXException e)
//         {
//             throw new XmlException("Unable to configure XML reader: "
//                 + e.toString(), e);
//         }
//         catch (DocumentException e)
//         {
//             throw new XmlException("Unable to read XML document: "
//                 + e.toString(), e);
//         }
//     }
// }


// Path: src/main/java/de/ailis/wlandsuite/game/blocks/ShopItemList.java
import org.dom4j.Document;
import org.dom4j.Element;
import de.ailis.wlandsuite.common.exceptions.GameException;
import de.ailis.wlandsuite.game.RotatingXorInputStream;
import de.ailis.wlandsuite.game.RotatingXorOutputStream;
import de.ailis.wlandsuite.game.parts.ShopItem;
import de.ailis.wlandsuite.io.SeekableInputStream;
import de.ailis.wlandsuite.io.SeekableOutputStream;
import de.ailis.wlandsuite.utils.XmlUtils;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

     * Reads an external shop item list file which is used by Displacer's hacked
     * EXE.
     *
     * @param stream
     *            The input stream
     * @return The shop item list
     * @throws IOException
     *             When file operation fails.
     */

    public static ShopItemList readHacked(final InputStream stream)
        throws IOException
    {
        return readData(new SeekableInputStream(stream));
    }


    /**
     * Writes the shop items to the specified output stream.
     *
     * @param stream
     *            The output stream
     * @param disk
     *            The disk id (0 or 1)
     * @throws IOException
     *             When file operation fails.
     */

    public void write(final OutputStream stream, final int disk) throws IOException
    {
        SeekableOutputStream seekStream;