コード例 #1
0
        public override void storeChunk(Chunk_Base chunk)
        {
            if (chunk is IChunkSoup)
            {
                if (groupRoot != null)
                {
                    groupRoot.addChunk(chunk);
                }
                else
                {
                    Log.Write("WMO: MOGP sub-chunk found before the MOGP chunk? Darkness! Madness!");
                }
            }
            else
            {
                Chunks.Add(chunk);

                if (chunk is Chunk_MOGP)
                {
                    groupRoot = (Chunk_MOGP)chunk;
                }
            }
        }
コード例 #2
0
        public new void parse()
        {
            base.parse();

            if (isRoot)
            {
                // Check version
                Chunk_Base version = getChunksByID(Chunk_MVER.Magic).FirstOrDefault();

                if (version == null || !(version is Chunk_MVER))
                {
                    throw new WMOException("File is not a valid WMO file (missing version header).");
                }

                // WMOv4 required.
                if (((Chunk_MVER)version).fileVersion != 17)
                {
                    throw new WMOException("Unsupported WMO version!");
                }

                // Root file needs to be a root file.
                if (!Chunks.Any(c => c.ChunkID == Chunk_MOHD.Magic))
                {
                    throw new WMOException("File is not a valid WMO file (missing root header).");
                }

                // Parse all group files and import their chunks.
                foreach (WMOFile groupFile in groupFiles)
                {
                    groupFile.parse();
                    Chunks.AddRange(groupFile.getChunks().Where(c => c.ChunkID != Chunk_MVER.Magic));
                    groupFile.flush();
                }

                Log.Write("WMO: Root file loaded with {0} group file children.", groupFiles.Count);
            }
        }
コード例 #3
0
ファイル: WMOFile.cs プロジェクト: Kruithne/W3DT
        public override void storeChunk(Chunk_Base chunk)
        {
            if (chunk is IChunkSoup)
            {
                if (groupRoot != null)
                    groupRoot.addChunk(chunk);
                else
                    Log.Write("WMO: MOGP sub-chunk found before the MOGP chunk? Darkness! Madness!");
            }
            else
            {
                Chunks.Add(chunk);

                if (chunk is Chunk_MOGP)
                    groupRoot = (Chunk_MOGP)chunk;
            }
        }
コード例 #4
0
ファイル: ADTFile.cs プロジェクト: Kruithne/W3DT
        public override void storeChunk(Chunk_Base chunk)
        {
            if (chunk is IChunkSoup)
            {
                if (CurrentSub != null)
                    CurrentSub.addChunk(chunk);
                else
                    Log.Write("ADT: Sub-chunk found before MCNK chunk? Shun the demons!");
            }
            else
            {
                Chunks.Add(chunk);

                if (chunk is Chunk_MCNK)
                    CurrentSub = (Chunk_MCNK)chunk;
            }
        }
コード例 #5
0
ファイル: ChunkedFormatBase.cs プロジェクト: Kruithne/W3DT
 public abstract void storeChunk(Chunk_Base chunk);
コード例 #6
0
ファイル: WDTFile.cs プロジェクト: Kruithne/W3DT
 public override void storeChunk(Chunk_Base chunk)
 {
     Chunks.Add(chunk);
 }