protected bool ReadHeader(BinaryReader reader) { Header = new ChunkHeader() { Tag = reader.ReadBytesAsString(4), Size = reader.ReadUInt32(), Version = reader.ReadUInt32(), Unknown = reader.ReadUInt32() }; string tag = ChunkUtils.Tag(Type()); if (Header.Tag != tag) { FastConsole.WriteLine(String.Format("{0}: Invalid tag.", tag)); return(false); } if (Header.Unknown != 0) { Debugger.Break(); } FastConsole.WriteLine(String.Format("[{0}] Version {1} ", Header.Tag, Header.Version)); return(true); }
protected void LogInfo(params string[] data) { for (int i = 0; i < data.Length; i++) { string tag = ChunkUtils.Tag(Type()); FastConsole.WriteLine(String.Format("{0}: {1}", tag, data[i])); } }
protected bool IsValidVersion(params UInt32[] validVersions) { for (int i = 0; i < validVersions.Length; i++) { if (Header.Version == validVersions[i]) { return(true); } } string tag = ChunkUtils.Tag(Type()); FastConsole.WriteLine(String.Format("{0}{1}: Invalid version.", tag, "Chunk")); return(false); }