예제 #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 canLoadZone    = (zoneTag != null && haveZoneLayout);
            bool canLoadPlay    = (playTag != null && havePlayLayout);

            if (canLoadZone || canLoadPlay)
            {
                FourthGenResourceGestalt     gestalt     = null;
                FourthGenResourceLayoutTable layoutTable = null;
                if (canLoadZone)
                {
                    gestalt = new FourthGenResourceGestalt(reader, zoneTag, MetaArea, Allocator, StringIDs, _buildInfo);
                }
                if (canLoadPlay)
                {
                    layoutTable = new FourthGenResourceLayoutTable(playTag, MetaArea, Allocator, _buildInfo);
                }

                _resources = new FourthGenResourceManager(gestalt, layoutTable, _tags, MetaArea, Allocator, _buildInfo);
            }
        }
 /// <summary>
 ///     Initializes a new instance of the <see cref="FourthGenResourceManager" /> 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 FourthGenResourceManager(FourthGenResourceGestalt gestalt, FourthGenResourceLayoutTable layoutTable, TagTable tags,
                                 FileSegmentGroup metaArea, MetaAllocator allocator, EngineDescription buildInfo)
 {
     _gestalt     = gestalt;
     _layoutTable = layoutTable;
     _tags        = tags;
     _metaArea    = metaArea;
     _allocator   = allocator;
     _buildInfo   = buildInfo;
 }