Ejemplo n.º 1
0
        internal static BaseProperty ReadAsZeroObject(PackageReader reader, FPropertyTag tag, FName type)
        {
            BaseProperty prop = type.String switch
            {
                "ByteProperty" => new ByteProperty(),
                "BoolProperty" => new BoolProperty(tag),
                "IntProperty" => new IntProperty(),
                "FloatProperty" => new FloatProperty(),
                "ObjectProperty" => new ObjectProperty(reader, 0),
                "NameProperty" => new NameProperty(),
                "DelegateProperty" => new DelegateProperty(),
                "DoubleProperty" => new DoubleProperty(),
                "ArrayProperty" => new ArrayProperty(),
                "StructProperty" => new StructProperty(tag),
                "StrProperty" => new StrProperty(),
                "TextProperty" => new TextProperty(),
                "InterfaceProperty" => new InterfaceProperty(),
                //"MulticastDelegateProperty" => new MulticastDelegateProperty(reader, tag),
                //"LazyObjectProperty" => new LazyObjectProperty(reader, tag),
                "SoftObjectProperty" => new SoftObjectProperty(),
                "AssetObjectProperty" => new SoftObjectProperty(),
                "UInt64Property" => new UInt64Property(),
                "UInt32Property" => new UInt32Property(),
                "UInt16Property" => new UInt16Property(),
                "Int64Property" => new Int64Property(),
                "Int16Property" => new Int16Property(),
                "Int8Property" => new Int8Property(),
                "MapProperty" => new MapProperty(),
                "SetProperty" => new SetProperty(),
                "EnumProperty" => new EnumProperty(tag),
                _ => null, //throw new NotImplementedException($"Parsing of {type.String} types aren't supported yet."),
            };

            return(prop);
        }
Ejemplo n.º 2
0
        internal ArrayProperty(PackageReader reader, FPropertyTag tag)
        {
            Position = reader.Position;

            int length = reader.ReadInt32();

            Value = new BaseProperty[length];

            FPropertyTag InnerTag = default;

            // Execute if UE4 version is at least VER_UE4_INNER_ARRAY_TAG_INFO
            if (tag.InnerType.String == "StructProperty")
            {
                // Serialize a PropertyTag for the inner property of this array, allows us to validate the inner struct to see if it has changed
                InnerTag = reader is IoPackageReader ? tag : new FPropertyTag(reader);
            }
            for (int i = 0; i < length; i++)
            {
                Value[i] = ReadAsObject(reader, InnerTag, tag.InnerType, ReadType.ARRAY);
            }
        }
Ejemplo n.º 3
0
 internal ArrayProperty()
 {
     Value = new BaseProperty[0];
 }