Beispiel #1
0
        public void Dispose()
        {
            AreaHeader       = null;
            MTEXChunk        = null;
            DoodadRefs       = null;
            SMMapObjDefs     = null;
            TilesInformation = null;

            foreach (var tile in Tiles)
            {
                tile.Dispose();
            }

            Tiles           = null;
            DataChunkHeader = null;
        }
Beispiel #2
0
        private bool BuildAreaHeader(BinaryReader reader)
        {
            try
            {
                var dataHeader = new DataChunkHeader(reader);
                if (dataHeader.Token != Tokens.MHDRChunk)
                {
                    throw new Exception($"Invalid token, got [{dataHeader.Token}] expected {"[MHDRChunk]"}");
                }

                AreaHeader = new SMAreaHeader(reader);
                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            return(false);
        }
Beispiel #3
0
        private bool BuildAreaHeader(BinaryReader reader)
        {
            try
            {
                DataChunkHeader.Fill(reader);
                if (DataChunkHeader.Token != Tokens.MHDRChunk)
                {
                    throw new Exception($"Invalid token, got [{DataChunkHeader.Token}] expected {"[MHDRChunk]"}");
                }

                AreaHeader = new SMAreaHeader(reader);
                return(true);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message);
            }

            return(false);
        }