Example #1
0
        private ForgeGlobalsDefinition ConvertForgeGlobals(ForgeGlobalsDefinition forg)
        {
            var currentForgTag = CacheContext.GetTag <ForgeGlobalsDefinition>("multiplayer\\forge_globals");
            var currentForg    = (ForgeGlobalsDefinition)CacheContext.Deserialize(CacheStream, currentForgTag);

            // hardcoded base indices:
            int[] baseBlockCounts = new int[] { 0, 15, 173, 6, 81, 468, 9, 12 };

            for (int i = baseBlockCounts[0]; i < forg.ReForgeMaterialTypes.Count; i++)
            {
                currentForg.ReForgeMaterialTypes.Add(forg.ReForgeMaterialTypes[i]);
            }

            for (int i = baseBlockCounts[1]; i < forg.ReForgeMaterialTypes.Count; i++)
            {
                currentForg.ReForgeMaterialTypes.Add(forg.ReForgeMaterialTypes[i]);
            }

            for (int i = baseBlockCounts[2]; i < forg.ReForgeObjects.Count; i++)
            {
                currentForg.ReForgeObjects.Add(forg.ReForgeObjects[i]);
            }

            for (int i = baseBlockCounts[3]; i < forg.Descriptions.Count; i++)
            {
                currentForg.Descriptions.Add(forg.Descriptions[i]);
            }

            for (int i = baseBlockCounts[4]; i < forg.PaletteCategories.Count; i++)
            {
                currentForg.PaletteCategories.Add(forg.PaletteCategories[i]);
            }

            for (int i = baseBlockCounts[5]; i < forg.Palette.Count; i++)
            {
                currentForg.Palette.Add(forg.Palette[i]);
            }

            for (int i = baseBlockCounts[6]; i < forg.WeatherEffects.Count; i++)
            {
                currentForg.WeatherEffects.Add(forg.WeatherEffects[i]);
            }

            for (int i = baseBlockCounts[7]; i < forg.Skies.Count; i++)
            {
                currentForg.Skies.Add(forg.Skies[i]);
            }

            // move over the rest of the definition
            currentForg.InvisibleRenderMethod = forg.InvisibleRenderMethod;
            currentForg.DefaultRenderMethod   = forg.DefaultRenderMethod;
            currentForg.PrematchCameraObject  = forg.PrematchCameraObject;
            currentForg.ModifierObject        = forg.ModifierObject;
            currentForg.KillVolumeObject      = forg.KillVolumeObject;
            currentForg.GarbageVolumeObject   = forg.GarbageVolumeObject;

            return(currentForg);
        }
Example #2
0
        public ParseItemsXmlCommand(HaloOnlineCacheContext cacheContext, CachedTagInstance instance, ForgeGlobalsDefinition definition) :
            base(true,

                 "ParseItemsXml",
                 "",

                 "ParseItemsXml <File>",

                 "")
        {
            CacheContext = cacheContext;
            Instance     = instance;
            Definition   = definition;
        }
Example #3
0
        public ParseItemsXmlCommand(GameCache cache, CachedTag instance, ForgeGlobalsDefinition definition) :
            base(true,

                 "ParseItemsXml",
                 "",

                 "ParseItemsXml <File>",

                 "")
        {
            Cache      = cache;
            Instance   = instance;
            Definition = definition;
        }
Example #4
0
 public static void Populate(CommandContext context, HaloOnlineCacheContext cacheContext, CachedTagInstance instance, ForgeGlobalsDefinition definition)
 {
     context.AddCommand(new ParseItemsXmlCommand(cacheContext, instance, definition));
 }
Example #5
0
        public static CommandContext Create(CommandContext parent, HaloOnlineCacheContext cacheContext, CachedTagInstance instance, ForgeGlobalsDefinition definition)
        {
            var groupName = cacheContext.GetString(instance.Group.Name);

            var context = new CommandContext(parent,
                                             string.Format("{0:X8}.{1}", instance.Index, groupName));

            Populate(context, cacheContext, instance, definition);

            return(context);
        }
Example #6
0
 public static void Populate(CommandContext context, GameCache cache, CachedTag instance, ForgeGlobalsDefinition definition)
 {
     context.AddCommand(new ParseItemsXmlCommand(cache, instance, definition));
 }