Class TagSystem
Inheritance
Namespace: Content.Shared.Tag
Assembly: Content.Shared.dll
Syntax
public sealed class TagSystem : EntitySystem
Methods
| Improve this Doc View SourceAddTag(TagComponent, String)
Tries to add a tag if it doesn't already exist.
Declaration
public bool AddTag(TagComponent component, string id)
Parameters
Type | Name | Description |
---|---|---|
TagComponent | component | |
System.String | id | The tag to add. |
Returns
Type | Description |
---|---|
System.Boolean | true if it was added, false if it already existed. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if no TagPrototype exists with the given id. |
AddTag(EntityUid, String)
Tries to add a tag to an entity if the tag doesn't already exist.
Declaration
public bool AddTag(EntityUid entity, string id)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | The entity to add the tag to. |
System.String | id | The tag to add. |
Returns
Type | Description |
---|---|
System.Boolean | true if it was added, false otherwise even if it already existed. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if no TagPrototype exists with the given id. |
AddTags(TagComponent, IEnumerable<String>)
Tries to add the given tags if they don't already exist.
Declaration
public bool AddTags(TagComponent component, IEnumerable<string> ids)
Parameters
Type | Name | Description |
---|---|---|
TagComponent | component | |
IEnumerable<System.String> | ids | The tags to add. |
Returns
Type | Description |
---|---|
System.Boolean | true if any tags were added, false if they all already existed. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if one of the ids represents an unregistered TagPrototype. |
AddTags(TagComponent, String[])
Tries to add the given tags if they don't already exist.
Declaration
public bool AddTags(TagComponent component, params string[] ids)
Parameters
Type | Name | Description |
---|---|---|
TagComponent | component | |
System.String[] | ids | The tags to add. |
Returns
Type | Description |
---|---|
System.Boolean | true if any tags were added, false if they all already existed. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if one of the ids represents an unregistered TagPrototype. |
AddTags(EntityUid, IEnumerable<String>)
Tries to add the given tags to an entity if the tags don't already exist.
Declaration
public bool AddTags(EntityUid entity, IEnumerable<string> ids)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | The entity to add the tag to. |
IEnumerable<System.String> | ids | The tags to add. |
Returns
Type | Description |
---|---|
System.Boolean | true if any tags were added, false otherwise even if they all already existed. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if one of the ids represents an unregistered TagPrototype. |
AddTags(EntityUid, String[])
Tries to add the given tags to an entity if the tags don't already exist.
Declaration
public bool AddTags(EntityUid entity, params string[] ids)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | The entity to add the tag to. |
System.String[] | ids | The tags to add. |
Returns
Type | Description |
---|---|
System.Boolean | true if any tags were added, false otherwise even if they all already existed. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if one of the ids represents an unregistered TagPrototype. |
HasAllTags(TagComponent, IEnumerable<String>)
Checks if all of the given tags have been added.
Declaration
public bool HasAllTags(TagComponent component, IEnumerable<string> ids)
Parameters
Type | Name | Description |
---|---|---|
TagComponent | component | |
IEnumerable<System.String> | ids | The tags to check for. |
Returns
Type | Description |
---|---|
System.Boolean | true if they all exist, false otherwise. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if one of the ids represents an unregistered TagPrototype. |
HasAllTags(TagComponent, String[])
Checks if all of the given tags have been added.
Declaration
public bool HasAllTags(TagComponent component, params string[] ids)
Parameters
Type | Name | Description |
---|---|---|
TagComponent | component | |
System.String[] | ids | The tags to check for. |
Returns
Type | Description |
---|---|
System.Boolean | true if they all exist, false otherwise. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if one of the ids represents an unregistered TagPrototype. |
HasAllTags(EntityUid, IEnumerable<String>)
Checks if all of the given tags have been added to an entity.
Declaration
public bool HasAllTags(EntityUid entity, IEnumerable<string> ids)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | The entity to check. |
IEnumerable<System.String> | ids | The tags to check for. |
Returns
Type | Description |
---|---|
System.Boolean | true if they all exist, false otherwise. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if one of the ids represents an unregistered TagPrototype. |
HasAllTags(EntityUid, String[])
Checks if all of the given tags have been added to an entity.
Declaration
public bool HasAllTags(EntityUid entity, params string[] ids)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | The entity to check. |
System.String[] | ids | The tags to check for. |
Returns
Type | Description |
---|---|
System.Boolean | true if they all exist, false otherwise. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if one of the ids represents an unregistered TagPrototype. |
HasAnyTag(TagComponent, IEnumerable<String>)
Checks if any of the given tags have been added.
Declaration
public bool HasAnyTag(TagComponent component, IEnumerable<string> ids)
Parameters
Type | Name | Description |
---|---|---|
TagComponent | component | |
IEnumerable<System.String> | ids | The tags to check for. |
Returns
Type | Description |
---|---|
System.Boolean | true if any of them exist, false otherwise. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if one of the ids represents an unregistered TagPrototype. |
HasAnyTag(TagComponent, String[])
Checks if any of the given tags have been added.
Declaration
public bool HasAnyTag(TagComponent component, params string[] ids)
Parameters
Type | Name | Description |
---|---|---|
TagComponent | component | |
System.String[] | ids | The tags to check for. |
Returns
Type | Description |
---|---|
System.Boolean | true if any of them exist, false otherwise. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if one of the ids represents an unregistered TagPrototype. |
HasAnyTag(EntityUid, IEnumerable<String>)
Checks if all of the given tags have been added to an entity.
Declaration
public bool HasAnyTag(EntityUid entity, IEnumerable<string> ids)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | The entity to check. |
IEnumerable<System.String> | ids | The tags to check for. |
Returns
Type | Description |
---|---|
System.Boolean | true if any of them exist, false otherwise. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if one of the ids represents an unregistered TagPrototype. |
HasAnyTag(EntityUid, String[])
Checks if all of the given tags have been added to an entity.
Declaration
public bool HasAnyTag(EntityUid entity, params string[] ids)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | The entity to check. |
System.String[] | ids | The tags to check for. |
Returns
Type | Description |
---|---|
System.Boolean | true if any of them exist, false otherwise. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if one of the ids represents an unregistered TagPrototype. |
HasTag(TagComponent, String)
Checks if a tag has been added.
Declaration
public bool HasTag(TagComponent component, string id)
Parameters
Type | Name | Description |
---|---|---|
TagComponent | component | |
System.String | id | The tag to check for. |
Returns
Type | Description |
---|---|
System.Boolean | true if it exists, false otherwise. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if no TagPrototype exists with the given id. |
HasTag(EntityUid, String)
Checks if a tag has been added to an entity.
Declaration
public bool HasTag(EntityUid entity, string id)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | The entity to check. |
System.String | id | The tag to check for. |
Returns
Type | Description |
---|---|
System.Boolean | true if it exists, false otherwise. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if no TagPrototype exists with the given id. |
HasTag(EntityUid, String, EntityQuery<TagComponent>)
Checks if a tag has been added to an entity.
Declaration
public bool HasTag(EntityUid entity, string id, EntityQuery<TagComponent> tagQuery)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | |
System.String | id | |
EntityQuery<TagComponent> | tagQuery |
Returns
Type | Description |
---|---|
System.Boolean |
Initialize()
Declaration
public override void Initialize()
RemoveTag(TagComponent, String)
Tries to remove a tag if it exists.
Declaration
public bool RemoveTag(TagComponent component, string id)
Parameters
Type | Name | Description |
---|---|---|
TagComponent | component | |
System.String | id |
Returns
Type | Description |
---|---|
System.Boolean | true if it was removed, false otherwise even if it didn't exist. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if no TagPrototype exists with the given id. |
RemoveTag(EntityUid, String)
Tries to remove a tag from an entity if it exists.
Declaration
public bool RemoveTag(EntityUid entity, string id)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | The entity to remove the tag from. |
System.String | id | The tag to remove. |
Returns
Type | Description |
---|---|
System.Boolean | true if it was removed, false otherwise even if it didn't exist. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if no TagPrototype exists with the given id. |
RemoveTags(TagComponent, IEnumerable<String>)
Tries to remove all of the given tags if they exist.
Declaration
public bool RemoveTags(TagComponent component, IEnumerable<string> ids)
Parameters
Type | Name | Description |
---|---|---|
TagComponent | component | |
IEnumerable<System.String> | ids | The tags to remove. |
Returns
Type | Description |
---|---|
System.Boolean | true if any tag was removed, false otherwise. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if one of the ids represents an unregistered TagPrototype. |
RemoveTags(TagComponent, String[])
Tries to remove all of the given tags if they exist.
Declaration
public bool RemoveTags(TagComponent component, params string[] ids)
Parameters
Type | Name | Description |
---|---|---|
TagComponent | component | |
System.String[] | ids | The tags to remove. |
Returns
Type | Description |
---|---|
System.Boolean | true if it was removed, false otherwise even if they didn't exist. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if one of the ids represents an unregistered TagPrototype. |
RemoveTags(EntityUid, IEnumerable<String>)
Tries to remove a tag from an entity if it exists.
Declaration
public bool RemoveTags(EntityUid entity, IEnumerable<string> ids)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | The entity to remove the tag from. |
IEnumerable<System.String> | ids | The tag to remove. |
Returns
Type | Description |
---|---|
System.Boolean | true if it was removed, false otherwise even if it didn't exist. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if one of the ids represents an unregistered TagPrototype. |
RemoveTags(EntityUid, String[])
Tries to remove a tag from an entity if it exists.
Declaration
public bool RemoveTags(EntityUid entity, params string[] ids)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | The entity to remove the tag from. |
System.String[] | ids | The tag to remove. |
Returns
Type | Description |
---|---|
System.Boolean | true if it was removed, false otherwise even if it didn't exist. Robust.Shared.Prototypes.UnknownPrototypeException |
TryAddTag(EntityUid, String)
Tries to add a tag to an entity if it has a TagComponent and the tag doesn't already exist.
Declaration
public bool TryAddTag(EntityUid entity, string id)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | The entity to add the tag to. |
System.String | id | The tag to add. |
Returns
Type | Description |
---|---|
System.Boolean | true if it was added, false otherwise even if it already existed. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if no TagPrototype exists with the given id. |
TryAddTags(EntityUid, IEnumerable<String>)
Tries to add the given tags to an entity if it has a TagComponent and the tags don't already exist.
Declaration
public bool TryAddTags(EntityUid entity, IEnumerable<string> ids)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | The entity to add the tag to. |
IEnumerable<System.String> | ids | The tags to add. |
Returns
Type | Description |
---|---|
System.Boolean | true if any tags were added, false otherwise even if they all already existed. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if one of the ids represents an unregistered TagPrototype. |
TryAddTags(EntityUid, String[])
Tries to add the given tags to an entity if it has a TagComponent and the tags don't already exist.
Declaration
public bool TryAddTags(EntityUid entity, params string[] ids)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | The entity to add the tag to. |
System.String[] | ids | The tags to add. |
Returns
Type | Description |
---|---|
System.Boolean | true if any tags were added, false otherwise even if they all already existed. |
Exceptions
Type | Condition |
---|---|
Robust.Shared.Prototypes.UnknownPrototypeException | Thrown if one of the ids represents an unregistered TagPrototype. |