Ejemplo n.º 1
0
        private static void MasterLoadData(MultiStructItemTemplateBase template, MhwMultiStructData structData)
        {
            // Master LoadData.
            template.WriteLine("");
            template.WriteLine("        public override void LoadFile(string targetFile) {");
            template.WriteLine("            using var reader = new BinaryReader(OpenFile(targetFile, EncryptionKey), Encoding.UTF8);");
            template.WriteLine("            data = new LinkedList<MhwStructDataContainer>();");

            foreach (var @struct in structData.structs)
            {
                var name        = @struct.SafeName;
                var targetList  = "";
                var genericType = $"<{name}";

                if (@struct.Has010Link)
                {
                    var targetName = @[email protected];
                    targetList   = $", {targetName}_.list";
                    genericType += $", {targetName}";
                }

                genericType += ">";

                template.WriteLine($"            var {name}_ = new MhwStructDataContainer{genericType}({name}.LoadData(reader{targetList}), typeof({name}));");

                if (@struct.Has010Link)
                {
                    template.WriteLine($"            {name}_.SetCountTargetToUpdate({@[email protected]}_, -1, \"{@struct._010Link.entry.SafeName}\");");
                }

                template.WriteLine($"            data.AddLast({name}_);");
            }

            template.WriteLine("        }");
        }
Ejemplo n.º 2
0
 public static void Generate(MultiStruct010TemplateBase template, MhwMultiStructData structData)
 {
     foreach (var @struct in structData.structs)
     {
         CreateStruct(template, @struct);
     }
 }
Ejemplo n.º 3
0
        public static void Generate(MultiStructItemTemplateBase template, MhwMultiStructData structData)
        {
            foreach (var @struct in structData.structs)
            {
                GenerateInnerClass(template, @struct);
            }

            MasterLoadData(template, structData);
        }