/* * TileMemory.java * * Created on June 8, 2006, 2:33 PM */ package Current.popups.Memory; import Current.*; import Current.manage.*; import Current.plot.Plotters.XPlotter; import java.awt.Color; import java.io.*; import java.util.*; /** * This class handles reading and writing tiles to files. * @author pat */ public class TileMemory { /** STATIC METHODS handle saving */ protected static final int WORDS_AND_COLORS=0, CONSTRUCTORS=1; /** takes a string containing the filename where you wish to store the tile data. ** "Files/Tiles/" will be prepended to the filename */ public static void saveWordsAndColors(String filename, Tile[] tiles){ try { FileOutputStream out=new FileOutputStream("Files/Tiles/"+filename); ObjectOutputStream objout=new ObjectOutputStream(out); // save the TileWrite type objout.writeInt(WORDS_AND_COLORS); objout.writeInt(tiles.length); for (int i=0; i