Vixen
c7401864
csharp
public sealed class GameplayTagTable

The baked tag tree: every tag a build knows, numbered so that a prefix test is a range test.

Read the guide page for this →

Remarks

Built once, by GameplayTagTableBuilder, out of every tag every definition in the content build mentions. Immutable afterwards, shared by every system, and identical on every machine that holds the same content — which is the property the wire depends on.

Numbering is a pre-order walk with siblings in ordinal order, so a tag's descendants occupy the contiguous half-open range [index, end) and Contains is two comparisons. It is also a pure function of the set of names, not of the order they were added — asserted, because the alternative is a table that depends on which file an importer read first and therefore on a directory listing.

⚠ A pure function of the set means adding a tag renumbers the ones after it. That is the price of the range test and it is paid in one place: an index is valid against one table and nowhere else. Compare BuildHash in the session handshake, and persist SymbolOf rather than an index — see GameplayTag.

Fields and properties (5)

  • public const int MaximumDepth

    How deep a tag may be. Refused above this, rather than overflowing a walk.

  • public static GameplayTagTable Empty

    A table with no tags in it. What a host that has loaded no content has.

  • public int Count

    How many tags it holds, implied parents included.

  • public GameplayTagRange All

    Every tag in it, as one range.

  • public uint BuildHash

    A hash of the whole table — every name, in index order. Two hosts whose tables disagree disagree about what every index means, so this is what a handshake compares.

Methods (13)

  • public bool TryResolve(string? name, out GameplayTag tag)

    Finds a tag by its dotted name.

  • public GameplayTag Resolve(string? name)

    Finds a tag by its dotted name.

  • public GameplayTag Require(string name)

    Finds a tag by its dotted name, and refuses to carry on without it.

  • public bool TryResolve(Symbol symbol, out GameplayTag tag)

    Finds a tag by the symbol of its name — the form durable state is stored in.

  • public string NameOf(GameplayTag tag)

    The dotted name of a tag.

  • public Symbol SymbolOf(GameplayTag tag)

    The interned hash of a tag's name — what durable state stores instead of an index.

  • public GameplayTag ParentOf(GameplayTag tag)

    The tag one level up — Damage.Fire for Damage.Fire.Burn.

  • public int DepthOf(GameplayTag tag)

    How many segments a tag has. A root is one.

  • public GameplayTagRange RangeOf(GameplayTag tag)

    The tag and everything beneath it, as the range a match tests against.

  • public GameplayTagRange RangeOf(string? name)

    The range a dotted prefix names.

  • public bool Matches(GameplayTag tag, GameplayTag prefix)

    Whether a tag is, or is beneath, another.

  • public bool Matches(GameplayTag tag, string? prefix)

    Whether a tag is, or is beneath, a named prefix.

  • public bool Holds(GameplayTag tag)

    Whether an index belongs to this table at all.

Used by (63, showing 40)

  • CreatureLibraryMmo.Shared
  • AbilityLibraryVixen.Gameplay.Combat
  • ChatLibraryVixen.Gameplay.Chat
  • ChatRouterTestsVixen.Gameplay.Chat.Tests
  • CollectionLibraryVixen.Gameplay.Collections
  • CollectionTestsVixen.Gameplay.Collections.Tests
  • CombatAttributesVixen.Gameplay.Combat
  • ContainerBasicsTestsVixen.Gameplay.Inventory.Tests
  • ContainerTransactionTestsVixen.Gameplay.Inventory.Tests
  • ContentVixen.Gameplay.Quests.Tests
  • ContentVixen.Gameplay.Inventory.Tests
  • CraftingLibraryVixen.Gameplay.Crafting
  • CraftingTestsVixen.Gameplay.Crafting.Tests
  • DefinitionCatalogVixen.Gameplay
  • DefinitionCatalogBuilderVixen.Gameplay
  • DefinitionCatalogTestsVixen.Gameplay.Tests
  • DefinitionContentTestsVixen.Gameplay.Content.Tests
  • DefinitionRegistryVixen.Gameplay
  • DynamicEventTemplateVixen.Gameplay.Quests
  • DynamicEventTestsVixen.Gameplay.Quests.Tests
  • EconomyLibraryVixen.Gameplay.Economy
  • EffectSetTestsVixen.Gameplay.Tests
  • EffectTemplateVixen.Gameplay
  • EventBusTestsVixen.Gameplay.Quests.Tests
  • ExplorationLibraryVixen.Gameplay.Exploration
  • ExplorationTestsVixen.Gameplay.Exploration.Tests
  • GameplayConfigTestsVixen.Gameplay.Tests
  • GameplaySubjectTestsVixen.Gameplay.Tests
  • GameplayTagQueryVixen.Gameplay
  • GameplayTagQueryTestsVixen.Gameplay.Tests
  • GameplayTagSetTestsVixen.Gameplay.Tests
  • GameplayTagTableBuilderVixen.Gameplay
  • GameplayTagTableTestsVixen.Gameplay.Tests
  • GroupTestsVixen.Gameplay.Social.Tests
  • GuildTestsVixen.Gameplay.Social.Tests
  • HousingLibraryVixen.Gameplay.Housing
  • HousingTestsVixen.Gameplay.Housing.Tests
  • IDefinitionRegistryVixen.Gameplay
  • InstanceLibraryVixen.Gameplay.Instances
  • InstanceRunTestsVixen.Gameplay.Instances.Tests