/// <summary>
 /// Initializes a new instance of the <see cref="FourthGenLanguagePackLoader" /> class.
 /// </summary>
 /// <param name="cacheFile">The cache file.</param>
 /// <param name="languageGlobals">The language globals.</param>
 /// <param name="buildInfo">Information about the cache file's engine.</param>
 /// <param name="reader">The stream to read from.</param>
 public FourthGenLanguagePackLoader(ICacheFile cacheFile, FourthGenLanguageGlobals languageGlobals,
                                    EngineDescription buildInfo, IReader reader)
 {
     _buildInfo       = buildInfo;
     _languageGlobals = languageGlobals;
     _languages       = languageGlobals.Languages.Where(l => l.StringCount != 0).Select(l => l.Language).ToList();
     LoadGroups(reader, cacheFile);
 }
		/// <summary>
		/// Initializes a new instance of the <see cref="FourthGenLanguagePackLoader" /> class.
		/// </summary>
		/// <param name="cacheFile">The cache file.</param>
		/// <param name="languageGlobals">The language globals.</param>
		/// <param name="buildInfo">Information about the cache file's engine.</param>
		/// <param name="reader">The stream to read from.</param>
		public FourthGenLanguagePackLoader(ICacheFile cacheFile, FourthGenLanguageGlobals languageGlobals,
			EngineDescription buildInfo, IReader reader)
		{
			_buildInfo = buildInfo;
			_languageGlobals = languageGlobals;
			_languages = languageGlobals.Languages.Where(l => l.StringCount != 0).Select(l => l.Language).ToList();
			LoadGroups(reader, cacheFile);
		}
Пример #3
0
		private void LoadLanguageGlobals(IReader reader)
		{
			// Find the language data
			ITag tempTag;
			StructureLayout tagLayout;
            if (!FindLanguageTable(out tempTag, out tagLayout))
			{
				// No language data
				_languageLoader = new FourthGenLanguagePackLoader();
				return;
			}
            FourthGenTag languageTag = (FourthGenTag)tempTag;

			// Read it
			reader.SeekTo(languageTag.MetaLocation.AsOffset());
			StructureValueCollection values = StructureReader.ReadStructure(reader, tagLayout);
			_languageInfo = new FourthGenLanguageGlobals(values, _segmenter, _header.LocalePointerConverter, _buildInfo);
			_languageLoader = new FourthGenLanguagePackLoader(this, _languageInfo, _buildInfo, reader);
		}