Пример #1
0
        private void LoadResourceManager(IReader reader)
        {
            ITag zoneTag           = _tags.FindTagByClass("zone");
            ITag playTag           = _tags.FindTagByClass("play");
            bool haveZoneLayout    = _buildInfo.Layouts.HasLayout("resource gestalt");
            bool havePlayLayout    = _buildInfo.Layouts.HasLayout("resource layout table");
            bool haveAltPlayLayout = _buildInfo.Layouts.HasLayout("resource layout table alt");
            bool canLoadZone       = (zoneTag != null && zoneTag.MetaLocation != null && haveZoneLayout);
            bool canLoadPlay       = (playTag != null && playTag.MetaLocation != null && havePlayLayout);

            if (canLoadZone || canLoadPlay)
            {
                ThirdGenResourceGestalt     gestalt     = null;
                ThirdGenResourceLayoutTable layoutTable = null;
                if (canLoadZone)
                {
                    gestalt = new ThirdGenResourceGestalt(reader, zoneTag, MetaArea, Allocator, StringIDs, _buildInfo, _expander);
                }

                if (canLoadPlay)
                {
                    layoutTable = new ThirdGenResourceLayoutTable(playTag, MetaArea, Allocator, _buildInfo, _expander);
                }
                else if (canLoadZone && haveAltPlayLayout)
                {
                    layoutTable = new ThirdGenResourceLayoutTable(zoneTag, MetaArea, Allocator, _buildInfo, _expander);
                    _zoneOnly   = true;
                }


                _resources = new ThirdGenResourceManager(gestalt, layoutTable, _tags, MetaArea, Allocator, _buildInfo, _expander);
            }
        }
Пример #2
0
		/// <summary>
		///     Initializes a new instance of the <see cref="ThirdGenResourceManager" /> class.
		/// </summary>
		/// <param name="gestalt">The cache file's resource gestalt.</param>
		/// <param name="layoutTable">The cache file's resource layout table.</param>
		/// <param name="tags">The cache file's tag table.</param>
		/// <param name="metaArea">The cache file's meta area.</param>
		/// <param name="allocator">The cache file's tag data allocator.</param>
		/// <param name="buildInfo">The cache file's build information.</param>
		public ThirdGenResourceManager(ThirdGenResourceGestalt gestalt, ThirdGenResourceLayoutTable layoutTable, TagTable tags,
			FileSegmentGroup metaArea, MetaAllocator allocator, EngineDescription buildInfo)
		{
			_gestalt = gestalt;
			_layoutTable = layoutTable;
			_tags = tags;
			_metaArea = metaArea;
			_allocator = allocator;
			_buildInfo = buildInfo;
		}
Пример #3
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="ThirdGenResourceManager" /> class.
 /// </summary>
 /// <param name="gestalt">The cache file's resource gestalt.</param>
 /// <param name="layoutTable">The cache file's resource layout table.</param>
 /// <param name="tags">The cache file's tag table.</param>
 /// <param name="metaArea">The cache file's meta area.</param>
 /// <param name="allocator">The cache file's tag data allocator.</param>
 /// <param name="buildInfo">The cache file's build information.</param>
 public ThirdGenResourceManager(ThirdGenResourceGestalt gestalt, ThirdGenResourceLayoutTable layoutTable, TagTable tags,
                                FileSegmentGroup metaArea, MetaAllocator allocator, EngineDescription buildInfo)
 {
     _gestalt     = gestalt;
     _layoutTable = layoutTable;
     _tags        = tags;
     _metaArea    = metaArea;
     _allocator   = allocator;
     _buildInfo   = buildInfo;
 }
Пример #4
0
		private void LoadResourceManager(IReader reader)
		{
			ITag zoneTag = _tags.FindTagByClass("zone");
			ITag playTag = _tags.FindTagByClass("play");
			bool haveZoneLayout = _buildInfo.Layouts.HasLayout("resource gestalt");
			bool havePlayLayout = _buildInfo.Layouts.HasLayout("resource layout table");
			bool canLoadZone = (zoneTag != null && haveZoneLayout);
			bool canLoadPlay = (playTag != null && havePlayLayout);
			if (canLoadZone || canLoadPlay)
			{
				ThirdGenResourceGestalt gestalt = null;
				ThirdGenResourceLayoutTable layoutTable = null;
				if (canLoadZone)
					gestalt = new ThirdGenResourceGestalt(reader, zoneTag, MetaArea, Allocator, StringIDs, _buildInfo);
				if (canLoadPlay)
					layoutTable = new ThirdGenResourceLayoutTable(playTag, MetaArea, Allocator, _buildInfo);

				_resources = new ThirdGenResourceManager(gestalt, layoutTable, _tags, MetaArea, Allocator, _buildInfo);
			}
		}
Пример #5
0
 private void LoadResourceManager(IReader reader)
 {
     ITag zoneTag = _tags.FindTagByClass("zone");
     ITag playTag = _tags.FindTagByClass("play");
     if (zoneTag != null && playTag != null && _buildInfo.Layouts.HasLayout("resource gestalt") &&
         _buildInfo.Layouts.HasLayout("resource layout table"))
     {
         var gestalt = new ThirdGenResourceGestalt(reader, zoneTag, MetaArea, Allocator, StringIDs, _buildInfo);
         var layoutTable = new ThirdGenResourceLayoutTable(playTag, MetaArea, Allocator, _buildInfo);
         _resources = new ThirdGenResourceManager(gestalt, layoutTable, _tags, MetaArea, Allocator, _buildInfo);
     }
 }