/// <summary>
        /// Loads a tileset into memory and installs the tiles into
        /// the factory's cache.
        /// </summary>
        public void Load(FileInfo file)
        {
            // Make sure it exists
            if (!file.Exists)
            {
                throw new SpriteException("Tileset " + file + " does not exist");
            }

            // Get the relative directory
            DirectoryInfo baseDir = file.Directory;

            // Load the tileset into memory
            TextReader    tr      = file.OpenText();
            XmlTextReader xtr     = new XmlTextReader(tr);
            TilesetReader tsr     = new TilesetReader();
            Tileset       tileset = tsr.Read(baseDir, xtr);

            xtr.Close();
            tr.Close();

            // Go through the tiles
            foreach (Tile tile in tileset.Tiles)
            {
                tiles[tile.ID] = tile;
            }
        }
        /// <summary>
        /// Loads a tileset into memory and installs the tiles into
        /// the factory's cache.
        /// </summary>
        public void Load(FileInfo file)
        {
            // Make sure it exists
            if (!file.Exists)
            {
                throw new SpriteException("Tileset " + file + " does not exist");
            }

            // Get the relative directory
            DirectoryInfo baseDir = file.Directory;

            // Load the tileset into memory
            TextReader tr = file.OpenText();
            XmlTextReader xtr = new XmlTextReader(tr);
            TilesetReader tsr = new TilesetReader();
            Tileset tileset = tsr.Read(baseDir, xtr);
            xtr.Close();
            tr.Close();

            // Go through the tiles
            foreach (Tile tile in tileset.Tiles)
            {
                tiles[tile.ID] = tile;
            }
        }