TSet

Sets are collections that have unique elements and specific operations such as union, intersections and differences.

Example of using a TSet as a UProperty

[UClass]
public class AMyShowcaseClass : AActor
{
    [UProperty(PropertyFlags.EditAnywhere | PropertyFlags.BlueprintReadWrite)]
    public TSet<int> MySet { get; set; }

    protected override void BeginPlay()
    {
        base.BeginPlay();

        MySet.Add(1);
        MySet.Add(2);
    }    
}

TMap can also be represented as an ISet inside of a UFunction

[UFunction(FunctionFlags.BlueprintCallable)]
public void TestSet(ISet<int> MySet)
{
    PrintString($"Set Count: {MySet.Count}");
}

Last updated