Beispiel #1
0
        public static FxVfxNode Read(BinaryReader reader, FxVfxNodeDefinition definition, StringType stringType)
        {
            var node = new FxVfxNode
            {
                definition = definition
            };

            foreach (var property in definition.properties)
            {
                var values = new List <object>();
                node.properties.Add(property.name, values);

                var arraySize = reader.ReadByte();
                if (Program.IsVerbose)
                {
                    Console.WriteLine($"Reading {property.name} ({arraySize}) at {reader.BaseStream.Position - 1}");
                }

                for (var i = 0; i < arraySize; i++)
                {
                    values.Add(ReadValue(reader, property.type, stringType));
                }
            }

            return(node);
        }
        private static FxVfxNodeDefinition GenerateNodeDefinition(DumpedNodeDefinition dumpedDefinition, IDictionary <uint, string> propertyNameLookup, string name)
        {
            var result = new FxVfxNodeDefinition
            {
                name       = name,
                properties = new List <FxVfxNodePropertyDefinition>()
            };

            foreach (var property in dumpedDefinition.properties)
            {
                var propertyName = property.name.ToString();
                if (propertyNameLookup.ContainsKey(property.name))
                {
                    propertyName = propertyNameLookup[property.name];
                }

                var newProp = new FxVfxNodePropertyDefinition
                {
                    name = propertyName,
                    type = ParseType((Type)property.type)
                };

                result.properties.Add(newProp);
            }

            return(result);
        }
Beispiel #3
0
        public static FxVfxNode FromTemplate(FxVfxNodeDefinition definition)
        {
            var node = new FxVfxNode
            {
                definition = definition
            };

            foreach (var property in definition.properties)
            {
                node.properties.Add(property.name, new List <object>());
            }

            return(node);
        }