//public FText Val23; public static void Run() { UScriptStruct unrealStruct = UScriptStruct.GetStruct <Test_SimpleStruct>(); Tests.Assert(unrealStruct != null, "Test_SimpleStruct"); Tests.AssertProperty <UBoolProperty>(unrealStruct, "Val0"); Tests.AssertProperty <UInt8Property>(unrealStruct, "Val1"); Tests.AssertProperty <UByteProperty>(unrealStruct, "Val2"); Tests.AssertProperty <UInt16Property>(unrealStruct, "Val3"); Tests.AssertProperty <UUInt16Property>(unrealStruct, "Val4"); Tests.AssertProperty <UIntProperty>(unrealStruct, "Val5"); Tests.AssertProperty <UUInt32Property>(unrealStruct, "Val6"); Tests.AssertProperty <UInt64Property>(unrealStruct, "Val7"); Tests.AssertProperty <UUInt64Property>(unrealStruct, "Val8"); Tests.AssertProperty <UFloatProperty>(unrealStruct, "Val9"); Tests.AssertProperty <UDoubleProperty>(unrealStruct, "Val10"); Tests.AssertProperty <UDelegateProperty>(unrealStruct, "Val11"); Tests.AssertProperty <UMulticastDelegateProperty>(unrealStruct, "Val12"); Tests.AssertProperty <UObjectProperty>(unrealStruct, "Val13"); Tests.AssertProperty <UEnumProperty>(unrealStruct, "Val14"); Tests.AssertProperty <UStructProperty>(unrealStruct, "Val15"); Tests.AssertProperty <UClassProperty>(unrealStruct, "Val16"); Tests.AssertProperty <ULazyObjectProperty>(unrealStruct, "Val17"); Tests.AssertProperty <UWeakObjectProperty>(unrealStruct, "Val18"); Tests.AssertProperty <USoftClassProperty>(unrealStruct, "Val19"); Tests.AssertProperty <USoftObjectProperty>(unrealStruct, "Val20"); Tests.AssertProperty <UStrProperty>(unrealStruct, "Val21"); Tests.AssertProperty <UNameProperty>(unrealStruct, "Val22"); //Tests.AssertProperty<UTextProperty>(unrealStruct, "Val23"); }
SDKClass ProcessStruct(UScriptStruct @class) { var sdkc = new SDKClass(); sdkc.ClassName = SDKUtilities.CleanupName(@class.NameWithPrefix); if (@class.SuperField != null) { sdkc.SuperClass = SDKUtilities.CleanupName(@class.SuperField.NameWithPrefix); var scNamespace = SDKUtilities.GetPackageName(@class.SuperField.Cast <UClass>()); if (!sdkc.UsedNamespaces.Contains(scNamespace)) { sdkc.UsedNamespaces.Add(scNamespace); } } sdkc.ClassSize = @class.PropertySize; sdkc.Namespace = SDKUtilities.GetPackageName(@class.Cast <UClass>()); var child = @class.Children; while (child != null) { if (child.IsA <UProperty>()) { sdkc.AddProperty(child.Cast <UProperty>()); } child = child.Next; } return(sdkc); }
// Could add another POD struct nested in here but it seems to not be blittable when // adding a POD struct into another POD struct. public static void Run() { UScriptStruct unrealStruct = UScriptStruct.GetStruct <Test_SimpleBlittableStruct>(); Tests.Assert(unrealStruct != null, "Test_SimpleBlittableStruct"); Tests.AssertProperty <UInt8Property>(unrealStruct, "Val1"); Tests.AssertProperty <UByteProperty>(unrealStruct, "Val2"); Tests.AssertProperty <UInt16Property>(unrealStruct, "Val3"); Tests.AssertProperty <UUInt16Property>(unrealStruct, "Val4"); Tests.AssertProperty <UIntProperty>(unrealStruct, "Val5"); Tests.AssertProperty <UUInt32Property>(unrealStruct, "Val6"); Tests.AssertProperty <UInt64Property>(unrealStruct, "Val7"); Tests.AssertProperty <UUInt64Property>(unrealStruct, "Val8"); Tests.AssertProperty <UFloatProperty>(unrealStruct, "Val9"); Tests.AssertProperty <UDoubleProperty>(unrealStruct, "Val10"); Tests.AssertProperty <UNameProperty>(unrealStruct, "Val11"); Tests.Assert(StructDefault <Test_SimpleBlittableStruct> .IsBlittableStruct, unrealStruct, "IsBlittableStruct"); Tests.Assert(unrealStruct.StructFlags.HasFlag(EStructFlags.IsPlainOldData), unrealStruct, "IsPlainOldData"); Test_SimpleBlittableStruct defaultValue = StructDefault <Test_SimpleBlittableStruct> .Value; Tests.AssertEqual(defaultValue, default(Test_SimpleBlittableStruct), unrealStruct, "default state"); }
public static void Run() { UScriptStruct unrealStruct = UScriptStruct.GetStruct <Test_FixedArrayInStruct>(); Tests.Assert(unrealStruct != null, "Test_FixedArrayInStruct"); Tests.AssertFixedArrayProperty <UInt8Property>(unrealStruct, "Array1", 3); Tests.AssertFixedArrayProperty <UByteProperty>(unrealStruct, "Array2", 4); Tests.AssertFixedArrayProperty <UInt16Property>(unrealStruct, "Array3", 5); Tests.AssertFixedArrayProperty <UUInt16Property>(unrealStruct, "Array4", 6); Tests.AssertFixedArrayProperty <UIntProperty>(unrealStruct, "Array5", 7); Tests.AssertFixedArrayProperty <UUInt32Property>(unrealStruct, "Array6", 8); Tests.AssertFixedArrayProperty <UInt64Property>(unrealStruct, "Array7", 9); Tests.AssertFixedArrayProperty <UUInt64Property>(unrealStruct, "Array8", 10); Tests.AssertFixedArrayProperty <UFloatProperty>(unrealStruct, "Array9", 11); Tests.AssertFixedArrayProperty <UDoubleProperty>(unrealStruct, "Array10", 12); Tests.AssertFixedArrayProperty <UDelegateProperty>(unrealStruct, "Array11", 13); Tests.AssertFixedArrayProperty <UMulticastDelegateProperty>(unrealStruct, "Array12", 14); Tests.AssertFixedArrayProperty <UObjectProperty>(unrealStruct, "Array13", 15); Tests.AssertFixedArrayProperty <UEnumProperty>(unrealStruct, "Array14", 16); Tests.AssertFixedArrayProperty <UStructProperty>(unrealStruct, "Array15", 17); Tests.AssertFixedArrayProperty <UClassProperty>(unrealStruct, "Array16", 18); Tests.AssertFixedArrayProperty <ULazyObjectProperty>(unrealStruct, "Array17", 19); Tests.AssertFixedArrayProperty <UWeakObjectProperty>(unrealStruct, "Array18", 20); Tests.AssertFixedArrayProperty <USoftClassProperty>(unrealStruct, "Array19", 21); Tests.AssertFixedArrayProperty <USoftObjectProperty>(unrealStruct, "Array20", 22); Tests.AssertFixedArrayProperty <UStrProperty>(unrealStruct, "Array21", 23); Tests.AssertFixedArrayProperty <UNameProperty>(unrealStruct, "Array22", 24); //Tests.AssertFixedArrayProperty<UTextProperty>(unrealStruct, "Array23", 25); Test_FixedArrayInStruct defaultValue = StructDefault <Test_FixedArrayInStruct> .Value; Tests.AssertEqual(defaultValue.Array1.Length, 3, unrealStruct, ".Array1"); Tests.AssertEqual(defaultValue.Array2.Length, 4, unrealStruct, ".Array2"); Tests.AssertEqual(defaultValue.Array3.Length, 5, unrealStruct, ".Array3"); Tests.AssertEqual(defaultValue.Array4.Length, 6, unrealStruct, ".Array4"); Tests.AssertEqual(defaultValue.Array5.Length, 7, unrealStruct, ".Array5"); Tests.AssertEqual(defaultValue.Array6.Length, 8, unrealStruct, ".Array6"); Tests.AssertEqual(defaultValue.Array7.Length, 9, unrealStruct, ".Array7"); Tests.AssertEqual(defaultValue.Array8.Length, 10, unrealStruct, ".Array8"); Tests.AssertEqual(defaultValue.Array9.Length, 11, unrealStruct, ".Array9"); Tests.AssertEqual(defaultValue.Array10.Length, 12, unrealStruct, ".Array10"); Tests.AssertEqual(defaultValue.Array11.Length, 13, unrealStruct, ".Array11"); Tests.AssertEqual(defaultValue.Array12.Length, 14, unrealStruct, ".Array12"); Tests.AssertEqual(defaultValue.Array13.Length, 15, unrealStruct, ".Array13"); Tests.AssertEqual(defaultValue.Array14.Length, 16, unrealStruct, ".Array14"); Tests.AssertEqual(defaultValue.Array15.Length, 17, unrealStruct, ".Array15"); Tests.AssertEqual(defaultValue.Array16.Length, 18, unrealStruct, ".Array16"); Tests.AssertEqual(defaultValue.Array17.Length, 19, unrealStruct, ".Array17"); Tests.AssertEqual(defaultValue.Array18.Length, 20, unrealStruct, ".Array18"); Tests.AssertEqual(defaultValue.Array19.Length, 21, unrealStruct, ".Array19"); Tests.AssertEqual(defaultValue.Array20.Length, 22, unrealStruct, ".Array20"); Tests.AssertEqual(defaultValue.Array21.Length, 23, unrealStruct, ".Array21"); Tests.AssertEqual(defaultValue.Array22.Length, 24, unrealStruct, ".Array22"); }
internal FMovieSceneSegment(PackageReader reader) { Range = new TRange <FFrameNumber>(reader); ID = reader.ReadInt32(); bAllowEmpty = reader.ReadUInt32() != 0; Impls = new UScriptStruct[reader.ReadUInt32()]; for (int i = 0; i < Impls.Length; i++) { Impls[i] = new UScriptStruct(reader, "SectionEvaluationData"); } }
//public HashSet<FText> Val23; public static void Run() { UScriptStruct unrealStruct = UScriptStruct.GetStruct <Test_SimpleStructTSet>(); Tests.Assert(unrealStruct != null, "Test_SimpleStructTSet"); Tests.AssertTSetProperty <UInt8Property>(unrealStruct, "Val1"); Tests.AssertTSetProperty <UByteProperty>(unrealStruct, "Val2"); Tests.AssertTSetProperty <UInt16Property>(unrealStruct, "Val3"); Tests.AssertTSetProperty <UUInt16Property>(unrealStruct, "Val4"); Tests.AssertTSetProperty <UIntProperty>(unrealStruct, "Val5"); Tests.AssertTSetProperty <UUInt32Property>(unrealStruct, "Val6"); Tests.AssertTSetProperty <UInt64Property>(unrealStruct, "Val7"); Tests.AssertTSetProperty <UUInt64Property>(unrealStruct, "Val8"); Tests.AssertTSetProperty <UFloatProperty>(unrealStruct, "Val9"); Tests.AssertTSetProperty <UDoubleProperty>(unrealStruct, "Val10"); //Tests.AssertTSetProperty<UDelegateProperty>(unrealStruct, "Val11"); //Tests.AssertTSetProperty<UMulticastDelegateProperty>(unrealStruct, "Val12"); Tests.AssertTSetProperty <UObjectProperty>(unrealStruct, "Val13"); Tests.AssertTSetProperty <UEnumProperty>(unrealStruct, "Val14"); Tests.AssertTSetProperty <UStructProperty>(unrealStruct, "Val15"); Tests.AssertTSetProperty <UClassProperty>(unrealStruct, "Val16"); Tests.AssertTSetProperty <ULazyObjectProperty>(unrealStruct, "Val17"); //Tests.AssertTSetProperty<UWeakObjectProperty>(unrealStruct, "Val18"); Tests.AssertTSetProperty <USoftClassProperty>(unrealStruct, "Val19"); Tests.AssertTSetProperty <USoftObjectProperty>(unrealStruct, "Val20"); Tests.AssertTSetProperty <UStrProperty>(unrealStruct, "Val21"); Tests.AssertTSetProperty <UNameProperty>(unrealStruct, "Val22"); //Tests.AssertTSetProperty<UTextProperty>(unrealStruct, "Val23"); Test_SimpleStructTSet defaultValue = StructDefault <Test_SimpleStructTSet> .Value; // Check all lists default to empty (they will be constructed by the marshaler) foreach (FieldInfo field in defaultValue.GetType().GetFields()) { // HashSet doesn't have a Count we can easily get, obtain it using reflection object collection = field.GetValue(defaultValue); int count = (int)collection.GetType().GetProperty("Count").GetValue(collection); Tests.AssertEqual(count, 0, unrealStruct, field.Name); } }
//public List<FText> Val23; public static void Run() { UScriptStruct unrealStruct = UScriptStruct.GetStruct <Test_SimpleStructTArray>(); Tests.Assert(unrealStruct != null, "Test_SimpleStructTArray"); Tests.AssertTArrayProperty <UInt8Property>(unrealStruct, "Val1"); Tests.AssertTArrayProperty <UByteProperty>(unrealStruct, "Val2"); Tests.AssertTArrayProperty <UInt16Property>(unrealStruct, "Val3"); Tests.AssertTArrayProperty <UUInt16Property>(unrealStruct, "Val4"); Tests.AssertTArrayProperty <UIntProperty>(unrealStruct, "Val5"); Tests.AssertTArrayProperty <UUInt32Property>(unrealStruct, "Val6"); Tests.AssertTArrayProperty <UInt64Property>(unrealStruct, "Val7"); Tests.AssertTArrayProperty <UUInt64Property>(unrealStruct, "Val8"); Tests.AssertTArrayProperty <UFloatProperty>(unrealStruct, "Val9"); Tests.AssertTArrayProperty <UDoubleProperty>(unrealStruct, "Val10"); Tests.AssertTArrayProperty <UDelegateProperty>(unrealStruct, "Val11"); Tests.AssertTArrayProperty <UMulticastDelegateProperty>(unrealStruct, "Val12"); Tests.AssertTArrayProperty <UObjectProperty>(unrealStruct, "Val13"); Tests.AssertTArrayProperty <UEnumProperty>(unrealStruct, "Val14"); Tests.AssertTArrayProperty <UStructProperty>(unrealStruct, "Val15"); Tests.AssertTArrayProperty <UClassProperty>(unrealStruct, "Val16"); Tests.AssertTArrayProperty <ULazyObjectProperty>(unrealStruct, "Val17"); Tests.AssertTArrayProperty <UWeakObjectProperty>(unrealStruct, "Val18"); Tests.AssertTArrayProperty <USoftClassProperty>(unrealStruct, "Val19"); Tests.AssertTArrayProperty <USoftObjectProperty>(unrealStruct, "Val20"); Tests.AssertTArrayProperty <UStrProperty>(unrealStruct, "Val21"); Tests.AssertTArrayProperty <UNameProperty>(unrealStruct, "Val22"); //Tests.AssertTArrayProperty<UTextProperty>(unrealStruct, "Val23"); Test_SimpleStructTArray defaultValue = StructDefault <Test_SimpleStructTArray> .Value; // Check all lists default to empty (they will be constructed by the marshaler) foreach (FieldInfo field in defaultValue.GetType().GetFields()) { Tests.AssertEqual((field.GetValue(defaultValue) as System.Collections.IList).Count, 0, unrealStruct, field.Name); } }
internal StructProperty(PackageReader reader, FPropertyTag tag) { Value = new UScriptStruct(reader, tag.StructName).Struct; }
internal StructProperty(FPropertyTag tag) { Value = null; Value = new UScriptStruct(tag.StructName.String).Struct; }