Show / Hide Table of Contents

Class TagSystem

Inheritance
System.Object
TagSystem
Namespace: Content.Shared.Tag
Assembly: Content.Shared.dll
Syntax
public sealed class TagSystem : EntitySystem

Methods

| Improve this Doc View Source

AddTag(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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
| Improve this Doc View Source

Initialize()

Declaration
public override void Initialize()
| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾