예제 #1
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);
        }
예제 #2
0
        private bool ReadMODF()
        {
            try
            {
                var dataHeader = new DataChunkHeader(this);
                if (dataHeader.Token == Tokens.MODF)
                {
                    MODF = new SMMapObjDef(this);
                }
                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            return(false);
        }
예제 #3
0
        private bool BuildMODF(BinaryReader reader)
        {
            try
            {
                var dataHeader = new DataChunkHeader(reader);
                if (dataHeader.Token != Tokens.MODF)
                {
                    throw new Exception($"Invalid token, got [{dataHeader.Token}] expected {"[MODF]"}");
                }

                //MODF (Placement information for WMOs. Additional to this, the WMOs to render are referenced in each MCRF chunk)
                var dataChunk = reader.ReadBytes(dataHeader.Size);
                SMMapObjDefs = SMMapObjDef.BuildFromChunk(dataChunk);
                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            return(false);
        }
예제 #4
0
        private bool ReadMODF()
        {
            try
            {
                if (this.IsEOF())
                {
                    return(false);
                }

                DataChunkHeader.Fill(this);
                if (DataChunkHeader.Token == Tokens.MODF)
                {
                    MODF = new SMMapObjDef(this);
                }
                return(true);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message);
            }

            return(false);
        }