UnrealSharp
  • Home
  • FAQ
  • Getting Started
    • Setup
    • Your First Script
    • Debugging
    • Packaging
  • Documentation
    • Classes
      • Properties
        • C++ Functions As C# Properties
        • C++ Properties with Getters/Setters
      • Functions
        • Flags
        • MetaData
      • Default Actor Components
      • Helper Methods
    • Structs
    • Enums
    • Interfaces
    • Delegates
    • Collections
      • TArray
      • TNativeArray
      • TSet
      • TMap
    • Multiplayer
      • Replicated Properties
      • RPCs (Remote Procedure Calls)
      • Replicated UObjects
    • Primary Data Assets
      • Loading Primary Data Assets
    • Loading Soft References
    • Trace Channels
    • Static Variables
      • FWorldStaticVar<T>
      • FGameStaticVar<T>
    • Logging
    • Async
    • Gameplay Tags
      • Gameplay Tag Container
    • Extension / Mixin Methods
    • Subsystems
    • Module Lifecycle
  • Links
    • Github Repository
    • Roadmap
    • Discord
Powered by GitBook
On this page
  1. Documentation
  2. Collections

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}");
}
PreviousTNativeArrayNextTMap

Last updated 6 months ago