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) { //only save tag header if its actually secondgen if (_tags is SecondGenTagTable) { ((SecondGenTagTable)_tags).SaveChanges(stream); _fileNames.SaveChanges(stream); } WriteStringBlock(stream); _stringIDs.SaveChanges(stream); if (_simulationDefinitions != null) { _simulationDefinitions.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); WriteHeader(stream); WriteLanguageInfo(stream); }
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); WriteStringBlock(stream); _fileNames.SaveChanges(stream); _stringIDs.SaveChanges(stream); if (_simulationDefinitions != null) { _simulationDefinitions.SaveChanges(stream); } WriteLanguageInfo(stream); _header.Checksum = ICacheFileExtensions.GenerateChecksum(this, stream); WriteHeader(stream); }
public void SaveChanges(IStream stream) { _tags.SaveChanges(stream); WriteStringBlock(stream); _fileNames.SaveChanges(stream); _stringIDs.SaveChanges(stream); if (_simulationDefinitions != null) { _simulationDefinitions.SaveChanges(stream); } CalculateChecksum(stream); WriteHeader(stream); WriteLanguageInfo(stream); }