* @throws IOException If restoring failed.
*/
@SuppressWarnings("unchecked")
public int restoreFromMemento(String memento) throws IOException {
final String dataString = memento.replaceAll("\\t", "\n");
final byte[] dataBytes = new BASE64Decoder().decodeBuffer(dataString);
final Object dataObject = new ClassedObjectTransmitter().turnClassedBytesToObject(dataBytes, null);
if (dataObject instanceof Map) {
this.treasureMap = (Map<String, TreasureHeap.Treasure>) dataObject;
final int treasureCount = this.treasureMap.size();
if (AgentopiaConstants.TREASURE_DEBUG) {