Ejemplo n.º 1
0
        public static RhgFile Deserialize(BinaryReader reader)
        {
            var file = new RhgFile();

            file.version = reader.ReadByte();

            RhgEntryType type;

            while ((type = (RhgEntryType)reader.ReadByte()) != RhgEntryType.EndOfEntry)
            {
                switch (type)
                {
                case RhgEntryType.Rhg:
                    file.rhgGuid = reader.ReadRhGuid();
                    break;

                case RhgEntryType.Internal:
                    file.internalGuid = reader.ReadRhGuid();
                    break;

                case RhgEntryType.Png:
                    file.pngGuid = reader.ReadRhGuid();
                    break;

                case RhgEntryType.PackName:
                    file.packName = reader.ReadShortPrefixedString();
                    break;

                case RhgEntryType.Rhc:
                    file.rhcGuids.Add(reader.ReadRhGuid());
                    break;

                default:
                    throw new Exception("Unknown group entry type: " + type);
                }
            }

            return(file);
        }
Ejemplo n.º 2
0
 public RhgSynchronizer(CacheFile cacheFile, RhgFile rhgFile) : base(cacheFile)
 {
     this.rhgFile = rhgFile;
 }