Cleans up tag system (#28272)

* Updated tag system

* Added params methods

* Fixed tag integration tests

* Fixed params methods recursion

* Revert has All/Any tag one argument realisation

* Updated tag integration tests

* Shit happens

* Added individual List/HashSet methods, docs, tests
This commit is contained in:
Tornado Tech
2024-06-02 11:11:19 +10:00
committed by GitHub
parent da6a1bbdd4
commit 21bc3bfa22
18 changed files with 834 additions and 780 deletions

View File

@@ -3,6 +3,7 @@ using System.Numerics;
using System.Runtime.CompilerServices;
using Content.Shared.Tag;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
@@ -24,7 +25,7 @@ public abstract class SharedNavMapSystem : EntitySystem
[Robust.Shared.IoC.Dependency] private readonly TagSystem _tagSystem = default!;
private readonly string[] _wallTags = ["Wall", "Window"];
private static readonly ProtoId<TagPrototype>[] WallTags = {"Wall", "Window"};
private EntityQuery<NavMapDoorComponent> _doorQuery;
public override void Initialize()
@@ -58,7 +59,7 @@ public abstract class SharedNavMapSystem : EntitySystem
if (_doorQuery.HasComp(uid))
return NavMapChunkType.Airlock;
if (_tagSystem.HasAnyTag(uid, _wallTags))
if (_tagSystem.HasAnyTag(uid, WallTags))
return NavMapChunkType.Wall;
return NavMapChunkType.Invalid;