Verse Library verse

01 Language

Uses a session-scoped weak map, optional binding, and conditional assignment to track and update values.

extracted-snippets/documentation/en-us/uefn/25.00-release-notes-in-unreal-editor-for-fortnite/01-language.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/25.00-release-notes-in-unreal-editor-for-fortnite
# Local doc:  epic-docs/documentation/en-us/uefn/25.00-release-notes-in-unreal-editor-for-fortnite.md
# Section:    Language
  var GlobalInt:weak_map(session, int) = map{}
  ExampleFunction():void=
      X := if (Y := GlobalInt[GetSession()]) then Y + 1 else 0
      if:
          set GlobalInt[GetSession()] = X
      Print({X})
Copy full snippet

Comments

    Sign in to vote, comment, or suggest an edit. Sign in