Exemplo n.º 1
0
        public bool LoadMap(String fileName)
        {
            // Open the file as a new stream
            _stream = new FileStream(fileName, FileMode.Open);

            // Make sure the filesize is larger than the header chunk
            FileInfo f = new FileInfo(fileName);

            Header = new MapHeader();
            if (f.Length < Header.ChunkSize())
            {
                throw new Exception("Not a valid map file!");
            }

            // Load header and tag table header
            LoadMapPortion(Header);
            LoadMapPortion(Tables = new TableManager(Header, this));

            // Close the stream
            _stream.Close();

            IsLoaded = true;

            return(true);
        }