Example #1
0
        private GraphNode ParseField(Field field, EmbeddedFile file)
        {
            switch (field.Type)
            {
            case FieldType.uint32:
            {
                uint fieldValue = file.ReadUInt32();
                return(new GraphNode(field.Name, NodeType.Primitive_uint32, file.Position - sizeof(UInt32),
                                     fieldValue));
            }

            case FieldType.uint16:
            {
                UInt16 fieldValue = file.ReadUInt16();
                return(new GraphNode(field.Name, NodeType.Primitive_uint16, file.Position - sizeof(UInt16),
                                     fieldValue));
            }

            case FieldType.single:
            {
                Single fieldValueSingle = file.ReadSingle();
                return(new GraphNode(field.Name, NodeType.Primitive_single, file.Position - sizeof(Single),
                                     fieldValueSingle));
            }

            default:
                throw new NotImplementedException();
            }
        }