public void SaveChanges(IStream stream) { _tags.SaveChanges(stream); _fileNames.SaveChanges(stream); _stringIds.SaveChanges(stream); if (_simulationDefinitions != null) { _simulationDefinitions.SaveChanges(stream); } if (_effects != null) { _effects.SaveChanges(stream); } int checksumOffset = WriteHeader(stream); WriteLanguageInfo(stream); if (checksumOffset != -1) { //checksum needs to be handled last due to WriteLanguageInfo writing where we need to calculate, //and WriteHeader updates important info for languages so it has to come before that, (but maybe that should be run separately?) //leaving this hacky checksum writing _header.Checksum = ICacheFileExtensions.GenerateChecksum(this, stream); stream.SeekTo(checksumOffset); stream.WriteUInt32(_header.Checksum); } }
public void SaveChanges(IStream stream) { _tags.SaveChanges(stream); _fileNames.SaveChanges(stream); _stringIds.SaveChanges(stream); if (_simulationDefinitions != null) { _simulationDefinitions.SaveChanges(stream); } WriteHeader(stream); WriteLanguageInfo(stream); }
public void SaveChanges(IStream stream) { _tags.SaveChanges(stream); _fileNames.SaveChanges(stream); _stringIds.SaveChanges(stream); if (_simulationDefinitions != null) { _simulationDefinitions.SaveChanges(stream); } if (_effects != null) { _effects.SaveChanges(stream); } WriteLanguageInfo(stream); _header.Checksum = ICacheFileExtensions.GenerateChecksum(this, stream); WriteHeader(stream); }