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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user