Пример #1
0
        private bool ReadMPHD()
        {
            try
            {
                var dataHeader = new DataChunkHeader(this);
                if (dataHeader.Token != Tokens.MPHD)
                {
                    throw new Exception($"Invalid token, got [{dataHeader.Token}] expected {"[MPHD]"}.");
                }

                var byteChunk = this.ReadBytes(dataHeader.Size);
                SMOHeader = new SMOHeader(byteChunk);

                if (Globals.Verbose)
                {
                    Console.WriteLine($"[MPHD] Success.");
                }

                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            return(false);
        }
Пример #2
0
        private bool ReadMPHD()
        {
            try
            {
                if (this.IsEOF())
                {
                    return(false);
                }

                DataChunkHeader.Fill(this);
                if (DataChunkHeader.Token != Tokens.MPHD)
                {
                    throw new Exception($"Invalid token, got [{DataChunkHeader.Token}] expected {"[MPHD]"}.");
                }

                var byteChunk = this.ReadBytes(DataChunkHeader.Size);
                SMOHeader = new SMOHeader(byteChunk);

                if (Globals.Verbose)
                {
                    Logger.Success($"[MPHD]");
                }

                return(true);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message);
            }

            return(false);
        }
Пример #3
0
        protected override void Dispose(bool disposing)
        {
            DBCMap                = null;
            Name                  = string.Empty;
            SMOHeader             = null;
            TileBlocksInformation = null;
            DoodadsNames.Clear();
            DoodadsNames = null;
            MapObjectsNames.Clear();
            MapObjectsNames = null;
            MODF            = null;
            TileBlocks      = null;
            DataChunkHeader = null;

            base.Dispose(disposing);
        }