// Path: game-common/src/main/java/com/game/common/util/PersistenceManager.java
// public class PersistenceManager {
// 	private static final Logger log = LoggerFactory.getLogger(PersistenceManager.class);
// 
// 	public class PacketHandler {
// 		public Packet.Type[] types;
// 		public Class<?> handler;
// 	}
// 
// 	public class ItemHandler {
// 		public int[] ids;
// 		public Class<?> handler;
// 	}
// 
// 	protected static final XStream xstream;
// 
// 	static {
// 		xstream = new XStream();
// 
// 		xstream.alias("type", Packet.Type.class);
// 
// 		xstream.alias("PacketHandler", PacketHandler.class);
// 		xstream.alias("ItemHandler", ItemHandler.class);
// 
// 		xstream.alias("ItemDef", Item.Definition.class);
// 		xstream.alias("TileDef", Tile.Definition.class);
// 	}
// 
// 	public static void alias(String name, Class<?> type) {
// 		xstream.alias(name, type);
// 	}
// 
// 	public static Object load(URL path) {
// 		try {
// 			InputStream in = path.openStream();
// 			Object o = xstream.fromXML(in);
// 			in.close();
// 
// 			return o;
// 		}
// 		catch (IOException ioe) {
// 			log.error("Error loading object: " + ioe.getMessage());
// 			System.exit(1); // fatal error
// 
// 			return null;
// 		}
// 	}
// 
// 	public static void save(Object o, File f) throws IOException {
// 		OutputStream out = new FileOutputStream(f);
// 		xstream.toXML(o, out);
// 		out.close();
// 	}
// }


import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.net.URL;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.game.common.util.PersistenceManager;
		return definition.edible > 0;
	}

	public int getEdible() {
		return definition.edible;
	}

	public String getName() {
		return definition.name;
	}

	public String getDescription() {
		return definition.description;
	}

	public boolean isStackable() {
		return definition.stackable;
	}

	@Override
	public String toString() {
		return "item[id = " + id + ", name = '" + definition.name + "', amount = " + amount + ", equiped = " + equiped + "]";
	}

	private void writeObject(ObjectOutputStream out) throws IOException {
		out.defaultWriteObject();
	}

	private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
		in.defaultReadObject();
// Path: game-common/src/main/java/com/game/common/util/PersistenceManager.java
// public class PersistenceManager {
// 	private static final Logger log = LoggerFactory.getLogger(PersistenceManager.class);
// 
// 	public class PacketHandler {
// 		public Packet.Type[] types;
// 		public Class<?> handler;
// 	}
// 
// 	public class ItemHandler {
// 		public int[] ids;
// 		public Class<?> handler;
// 	}
// 
// 	protected static final XStream xstream;
// 
// 	static {
// 		xstream = new XStream();
// 
// 		xstream.alias("type", Packet.Type.class);
// 
// 		xstream.alias("PacketHandler", PacketHandler.class);
// 		xstream.alias("ItemHandler", ItemHandler.class);
// 
// 		xstream.alias("ItemDef", Item.Definition.class);
// 		xstream.alias("TileDef", Tile.Definition.class);
// 	}
// 
// 	public static void alias(String name, Class<?> type) {
// 		xstream.alias(name, type);
// 	}
// 
// 	public static Object load(URL path) {
// 		try {
// 			InputStream in = path.openStream();
// 			Object o = xstream.fromXML(in);
// 			in.close();
// 
// 			return o;
// 		}
// 		catch (IOException ioe) {
// 			log.error("Error loading object: " + ioe.getMessage());
// 			System.exit(1); // fatal error
// 
// 			return null;
// 		}
// 	}
// 
// 	public static void save(Object o, File f) throws IOException {
// 		OutputStream out = new FileOutputStream(f);
// 		xstream.toXML(o, out);
// 		out.close();
// 	}
// }


// Path: game-common/src/main/java/com/game/common/model/Item.java
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.net.URL;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.game.common.util.PersistenceManager;

		return definition.edible > 0;
	}

	public int getEdible() {
		return definition.edible;
	}

	public String getName() {
		return definition.name;
	}

	public String getDescription() {
		return definition.description;
	}

	public boolean isStackable() {
		return definition.stackable;
	}

	@Override
	public String toString() {
		return "item[id = " + id + ", name = '" + definition.name + "', amount = " + amount + ", equiped = " + equiped + "]";
	}

	private void writeObject(ObjectOutputStream out) throws IOException {
		out.defaultWriteObject();
	}

	private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
		in.defaultReadObject();
		this.setID(id); // Re-set the ID, this will set our definition up