Vixen
c7401864
csharp
public readonly record struct GameplayTag

One hierarchical, interned gameplay tag — Damage.Fire.Burn, in four bytes.

Read the guide page for this →

Remarks

The highest-leverage type in the gameplay libraries (doc 28 § Tags): requirements, immunities, loot conditions, quest objectives, effect stacking, chat gating, matchmaking eligibility, achievement criteria and interaction filters are all tag queries, so a game adds a rule at the altitude it means it by writing a tag rather than a class.

The value is a pre-order index into a GameplayTagTable, not a hash. That is the whole reason a prefix test is two integer comparisons: a pre-order walk gives every tag's descendants a contiguous range of indices, so "is this tag under Damage.Fire" is index >= start && index < end — see GameplayTagRange. A hash would make the id independent of any table and make every prefix test a string operation, which is the trade the other way round and the wrong one for a value compared on the damage path.

⚠ An index is only meaningful against the table that assigned it, and adding a tag renumbers. Two consequences, both deliberate and both stated here because getting either wrong is silent. On the wire: both ends must hold the same table, which they do because the session handshake compares the catalog's build hash before anything is dispatched ([16](../../../docs/plan/16-networking.md) § Security) and BuildHash is what a table contributes to it. In durable state: never persist an index. Persist SymbolOf's symbol, which is a hash of the name and survives every renumbering; a saved character holding indices would be a saved character whose immunities changed meaning the next time somebody added a tag.

Fields and properties (3)

  • public uint Index

    The tag's position in the pre-order walk of its table, counting from one. Zero is None.

  • public static GameplayTag None

    Not a tag. Matches nothing, and nothing matches it.

  • public bool IsSome

    Whether this names one.

Methods (7)

  • public GameplayTag(uint Index)

    One hierarchical, interned gameplay tag — Damage.Fire.Burn, in four bytes.

  • public int CompareTo(GameplayTag other)

    Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

  • public static bool operator <(GameplayTag left, GameplayTag right)

    Orders by index, which is the pre-order walk — a parent sorts before its children.

  • public static bool operator <=(GameplayTag left, GameplayTag right)

    Orders by index.

  • public static bool operator >(GameplayTag left, GameplayTag right)

    Orders by index.

  • public static bool operator >=(GameplayTag left, GameplayTag right)

    Orders by index.

  • public override string ToString()

Used by (70, showing 40)

  • CreatureMmo.Shared
  • CreatureLibraryMmo.Shared
  • AbilityCasterVixen.Gameplay.Combat
  • AbilityLibraryVixen.Gameplay.Combat
  • AbilityTemplateVixen.Gameplay.Combat
  • AchievementVixen.Gameplay.Collections
  • AffixTemplateVixen.Gameplay.Items
  • CollectibleVixen.Gameplay.Collections
  • CollectionLibraryVixen.Gameplay.Collections
  • CollectionRecordVixen.Gameplay.Collections
  • CollectionTestsVixen.Gameplay.Collections.Tests
  • ContainerVixen.Gameplay.Inventory
  • ContainerSetVixen.Gameplay.Inventory
  • ContentVixen.Gameplay.Quests.Tests
  • CurrencyVixen.Gameplay.Economy
  • DamageEventVixen.Gameplay.Combat
  • DefinitionContentTestsVixen.Gameplay.Content.Tests
  • DifficultyVixen.Gameplay.Instances
  • DynamicEventTemplateVixen.Gameplay.Quests
  • EffectSetVixen.Gameplay
  • EffectTemplateVixen.Gameplay
  • EnumeratorVixen.Gameplay
  • ExplorationRecordVixen.Gameplay.Exploration
  • FurnitureVixen.Gameplay.Housing
  • GameplayEventVixen.Gameplay
  • GameplayTagRangeVixen.Gameplay
  • GameplayTagSetVixen.Gameplay
  • GameplayTagSetTestsVixen.Gameplay.Tests
  • GameplayTagTableVixen.Gameplay
  • GameplayTagTableTestsVixen.Gameplay.Tests
  • GroupMemberVixen.Gameplay.Social
  • GroupPolicyVixen.Gameplay.Social
  • GroupTestsVixen.Gameplay.Social.Tests
  • GuildCharterVixen.Gameplay.Social
  • GuildRankVixen.Gameplay.Social
  • HousePlotVixen.Gameplay.Housing
  • HousingTestsVixen.Gameplay.Housing.Tests
  • InteractableVixen.Gameplay.Interaction
  • InteractionLibraryVixen.Gameplay.Interaction
  • InteractionNodeVixen.Gameplay.Interaction