public static bool MakeType(UEPropertyFlags flags, out Package.Method.Parameter.Type type) { type = Package.Method.Parameter.Type.Default; if (flags.HasFlag(UEPropertyFlags.ReturnParm)) { type = Package.Method.Parameter.Type.Return; } else if (flags.HasFlag(UEPropertyFlags.OutParm)) { //if it is a const parameter make it a default parameter type = flags.HasFlag(UEPropertyFlags.ConstParm) ? Package.Method.Parameter.Type.Default : Package.Method.Parameter.Type.Out; } else if (flags.HasFlag(UEPropertyFlags.Parm)) { type = Package.Method.Parameter.Type.Default; } else { return(false); } return(true); }
/// <summary> /// Generates a valid type of the property flags. /// </summary> /// <param name="flags">The property flags.</param> /// <param name="type">[out] The parameter type.</param> /// <returns>true if it is a valid type, else false.</returns> public bool MakeType(UEPropertyFlags flags, out Type type) { type = Type.Default; switch (_unrealVersion) { case UnrealVersion.Unreal4: return(PackageCore.MakeType(flags, out type)); } return(false); }
public static string StringifyFlags(UEPropertyFlags flags) { var buffer = new List <string>(); if (flags.HasFlag(UEPropertyFlags.Edit)) { buffer.Add("Edit"); } if (flags.HasFlag(UEPropertyFlags.ConstParm)) { buffer.Add("ConstParm"); } if (flags.HasFlag(UEPropertyFlags.BlueprintVisible)) { buffer.Add("BlueprintVisible"); } if (flags.HasFlag(UEPropertyFlags.ExportObject)) { buffer.Add("ExportObject"); } if (flags.HasFlag(UEPropertyFlags.BlueprintReadOnly)) { buffer.Add("BlueprintReadOnly"); } if (flags.HasFlag(UEPropertyFlags.Net)) { buffer.Add("Net"); } if (flags.HasFlag(UEPropertyFlags.EditFixedSize)) { buffer.Add("EditFixedSize"); } if (flags.HasFlag(UEPropertyFlags.Parm)) { buffer.Add("Parm"); } if (flags.HasFlag(UEPropertyFlags.OutParm)) { buffer.Add("OutParm"); } if (flags.HasFlag(UEPropertyFlags.ZeroConstructor)) { buffer.Add("ZeroConstructor"); } if (flags.HasFlag(UEPropertyFlags.ReturnParm)) { buffer.Add("ReturnParm"); } if (flags.HasFlag(UEPropertyFlags.DisableEditOnTemplate)) { buffer.Add("DisableEditOnTemplate"); } if (flags.HasFlag(UEPropertyFlags.Transient)) { buffer.Add("Transient"); } if (flags.HasFlag(UEPropertyFlags.Config)) { buffer.Add("Config"); } if (flags.HasFlag(UEPropertyFlags.DisableEditOnInstance)) { buffer.Add("DisableEditOnInstance"); } if (flags.HasFlag(UEPropertyFlags.EditConst)) { buffer.Add("EditConst"); } if (flags.HasFlag(UEPropertyFlags.GlobalConfig)) { buffer.Add("GlobalConfig"); } if (flags.HasFlag(UEPropertyFlags.InstancedReference)) { buffer.Add("InstancedReference"); } if (flags.HasFlag(UEPropertyFlags.DuplicateTransient)) { buffer.Add("DuplicateTransient"); } if (flags.HasFlag(UEPropertyFlags.SubobjectReference)) { buffer.Add("SubobjectReference"); } if (flags.HasFlag(UEPropertyFlags.SaveGame)) { buffer.Add("SaveGame"); } if (flags.HasFlag(UEPropertyFlags.NoClear)) { buffer.Add("NoClear"); } if (flags.HasFlag(UEPropertyFlags.ReferenceParm)) { buffer.Add("ReferenceParm"); } if (flags.HasFlag(UEPropertyFlags.BlueprintAssignable)) { buffer.Add("BlueprintAssignable"); } if (flags.HasFlag(UEPropertyFlags.Deprecated)) { buffer.Add("Deprecated"); } if (flags.HasFlag(UEPropertyFlags.IsPlainOldData)) { buffer.Add("IsPlainOldData"); } if (flags.HasFlag(UEPropertyFlags.RepSkip)) { buffer.Add("RepSkip"); } if (flags.HasFlag(UEPropertyFlags.RepNotify)) { buffer.Add("RepNotify"); } if (flags.HasFlag(UEPropertyFlags.Interp)) { buffer.Add("Interp"); } if (flags.HasFlag(UEPropertyFlags.NonTransactional)) { buffer.Add("NonTransactional"); } if (flags.HasFlag(UEPropertyFlags.EditorOnly)) { buffer.Add("EditorOnly"); } if (flags.HasFlag(UEPropertyFlags.NoDestructor)) { buffer.Add("NoDestructor"); } if (flags.HasFlag(UEPropertyFlags.AutoWeak)) { buffer.Add("AutoWeak"); } if (flags.HasFlag(UEPropertyFlags.ContainsInstancedReference)) { buffer.Add("ContainsInstancedReference"); } if (flags.HasFlag(UEPropertyFlags.AssetRegistrySearchable)) { buffer.Add("AssetRegistrySearchable"); } if (flags.HasFlag(UEPropertyFlags.SimpleDisplay)) { buffer.Add("SimpleDisplay"); } if (flags.HasFlag(UEPropertyFlags.AdvancedDisplay)) { buffer.Add("AdvancedDisplay"); } if (flags.HasFlag(UEPropertyFlags.Protected)) { buffer.Add("Protected"); } if (flags.HasFlag(UEPropertyFlags.BlueprintCallable)) { buffer.Add("BlueprintCallable"); } if (flags.HasFlag(UEPropertyFlags.BlueprintAuthorityOnly)) { buffer.Add("BlueprintAuthorityOnly"); } if (flags.HasFlag(UEPropertyFlags.TextExportTransient)) { buffer.Add("TextExportTransient"); } if (flags.HasFlag(UEPropertyFlags.NonPIEDuplicateTransient)) { buffer.Add("NonPIEDuplicateTransient"); } if (flags.HasFlag(UEPropertyFlags.ExposeOnSpawn)) { buffer.Add("ExposeOnSpawn"); } if (flags.HasFlag(UEPropertyFlags.PersistentInstance)) { buffer.Add("PersistentInstance"); } if (flags.HasFlag(UEPropertyFlags.UObjectWrapper)) { buffer.Add("UObjectWrapper"); } if (flags.HasFlag(UEPropertyFlags.HasGetValueTypeHash)) { buffer.Add("HasGetValueTypeHash"); } if (flags.HasFlag(UEPropertyFlags.NativeAccessSpecifierPublic)) { buffer.Add("NativeAccessSpecifierPublic"); } if (flags.HasFlag(UEPropertyFlags.NativeAccessSpecifierProtected)) { buffer.Add("NativeAccessSpecifierProtected"); } if (flags.HasFlag(UEPropertyFlags.NativeAccessSpecifierPrivate)) { buffer.Add("NativeAccessSpecifierPrivate"); } switch (buffer.Count) { case 0: return(string.Empty); case 1: return(buffer[0]); default: return(string.Join(", ", buffer)); // TODO: Check if it's good } }
public static bool And(UEPropertyFlags lhs, UEPropertyFlags rhs) => ((int)lhs & (int)rhs) == (int)rhs;