/// <exception cref="UnknownPrototypeException">
/// Thrown if no <see cref="TagPrototype"/> exists with the given id.
/// </exception>
- public bool AddTag(EntityUid entityUid, ProtoId<TagPrototype> tag)
+ public bool AddTag(EntityUid entityUid, [ForbidLiteral] ProtoId<TagPrototype> tag)
{
return AddTag((entityUid, EnsureComp<TagComponent>(entityUid)), tag);
}
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool AddTags(EntityUid entityUid, params ProtoId<TagPrototype>[] tags)
+ public bool AddTags(EntityUid entityUid, [ForbidLiteral] params ProtoId<TagPrototype>[] tags)
{
- return AddTags(entityUid, (IEnumerable<ProtoId<TagPrototype>>)tags);
+ return AddTags(entityUid, (IEnumerable<ProtoId<TagPrototype>>)tags);
}
/// <summary>
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool AddTags(EntityUid entityUid, IEnumerable<ProtoId<TagPrototype>> tags)
+ public bool AddTags(EntityUid entityUid, [ForbidLiteral] IEnumerable<ProtoId<TagPrototype>> tags)
{
return AddTags((entityUid, EnsureComp<TagComponent>(entityUid)), tags);
}
/// <exception cref="UnknownPrototypeException">
/// Thrown if no <see cref="TagPrototype"/> exists with the given id.
/// </exception>
- public bool TryAddTag(EntityUid entityUid, ProtoId<TagPrototype> tag)
+ public bool TryAddTag(EntityUid entityUid, [ForbidLiteral] ProtoId<TagPrototype> tag)
{
return _tagQuery.TryComp(entityUid, out var component) &&
AddTag((entityUid, component), tag);
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool TryAddTags(EntityUid entityUid, params ProtoId<TagPrototype>[] tags)
+ public bool TryAddTags(EntityUid entityUid, [ForbidLiteral] params ProtoId<TagPrototype>[] tags)
{
return TryAddTags(entityUid, (IEnumerable<ProtoId<TagPrototype>>)tags);
}
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool TryAddTags(EntityUid entityUid, IEnumerable<ProtoId<TagPrototype>> tags)
+ public bool TryAddTags(EntityUid entityUid, [ForbidLiteral] IEnumerable<ProtoId<TagPrototype>> tags)
{
return _tagQuery.TryComp(entityUid, out var component) &&
AddTags((entityUid, component), tags);
/// <exception cref="UnknownPrototypeException">
/// Thrown if no <see cref="TagPrototype"/> exists with the given id.
/// </exception>
- public bool HasTag(EntityUid entityUid, ProtoId<TagPrototype> tag)
+ public bool HasTag(EntityUid entityUid, [ForbidLiteral] ProtoId<TagPrototype> tag)
{
return _tagQuery.TryComp(entityUid, out var component) &&
HasTag(component, tag);
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool HasAllTags(EntityUid entityUid, params ProtoId<TagPrototype>[] tags)
+ public bool HasAllTags(EntityUid entityUid, [ForbidLiteral] params ProtoId<TagPrototype>[] tags)
{
return _tagQuery.TryComp(entityUid, out var component) &&
HasAllTags(component, tags);
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool HasAllTags(EntityUid entityUid, HashSet<ProtoId<TagPrototype>> tags)
+ public bool HasAllTags(EntityUid entityUid, [ForbidLiteral] HashSet<ProtoId<TagPrototype>> tags)
{
return _tagQuery.TryComp(entityUid, out var component) &&
HasAllTags(component, tags);
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool HasAllTags(EntityUid entityUid, List<ProtoId<TagPrototype>> tags)
+ public bool HasAllTags(EntityUid entityUid, [ForbidLiteral] List<ProtoId<TagPrototype>> tags)
{
return _tagQuery.TryComp(entityUid, out var component) &&
HasAllTags(component, tags);
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool HasAllTags(EntityUid entityUid, IEnumerable<ProtoId<TagPrototype>> tags)
+ public bool HasAllTags(EntityUid entityUid, [ForbidLiteral] IEnumerable<ProtoId<TagPrototype>> tags)
{
return _tagQuery.TryComp(entityUid, out var component) &&
HasAllTags(component, tags);
/// <exception cref="UnknownPrototypeException">
/// Thrown if no <see cref="TagPrototype"/> exists with the given id.
/// </exception>
- public bool HasAnyTag(EntityUid entityUid, ProtoId<TagPrototype> tag) =>
+ public bool HasAnyTag(EntityUid entityUid, [ForbidLiteral] ProtoId<TagPrototype> tag) =>
HasTag(entityUid, tag);
/// <summary>
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool HasAnyTag(EntityUid entityUid, params ProtoId<TagPrototype>[] tags)
+ public bool HasAnyTag(EntityUid entityUid, [ForbidLiteral] params ProtoId<TagPrototype>[] tags)
{
return _tagQuery.TryComp(entityUid, out var component) &&
HasAnyTag(component, tags);
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool HasAnyTag(EntityUid entityUid, HashSet<ProtoId<TagPrototype>> tags)
+ public bool HasAnyTag(EntityUid entityUid, [ForbidLiteral] HashSet<ProtoId<TagPrototype>> tags)
{
return _tagQuery.TryComp(entityUid, out var component) &&
HasAnyTag(component, tags);
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool HasAnyTag(EntityUid entityUid, List<ProtoId<TagPrototype>> tags)
+ public bool HasAnyTag(EntityUid entityUid, [ForbidLiteral] List<ProtoId<TagPrototype>> tags)
{
return _tagQuery.TryComp(entityUid, out var component) &&
HasAnyTag(component, tags);
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool HasAnyTag(EntityUid entityUid, IEnumerable<ProtoId<TagPrototype>> tags)
+ public bool HasAnyTag(EntityUid entityUid, [ForbidLiteral] IEnumerable<ProtoId<TagPrototype>> tags)
{
return _tagQuery.TryComp(entityUid, out var component) &&
HasAnyTag(component, tags);
/// <exception cref="UnknownPrototypeException">
/// Thrown if no <see cref="TagPrototype"/> exists with the given id.
/// </exception>
- public bool HasTag(TagComponent component, ProtoId<TagPrototype> tag)
+ public bool HasTag(TagComponent component, [ForbidLiteral] ProtoId<TagPrototype> tag)
{
#if DEBUG
AssertValidTag(tag);
/// <exception cref="UnknownPrototypeException">
/// Thrown if no <see cref="TagPrototype"/> exists with the given id.
/// </exception>
- public bool HasAllTags(TagComponent component, ProtoId<TagPrototype> tag) =>
+ public bool HasAllTags(TagComponent component, [ForbidLiteral] ProtoId<TagPrototype> tag) =>
HasTag(component, tag);
/// <summary>
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool HasAllTags(TagComponent component, params ProtoId<TagPrototype>[] tags)
+ public bool HasAllTags(TagComponent component, [ForbidLiteral] params ProtoId<TagPrototype>[] tags)
{
foreach (var tag in tags)
{
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool HasAllTagsArray(TagComponent component, ProtoId<TagPrototype>[] tags)
+ public bool HasAllTagsArray(TagComponent component, [ForbidLiteral] ProtoId<TagPrototype>[] tags)
{
foreach (var tag in tags)
{
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool HasAllTags(TagComponent component, List<ProtoId<TagPrototype>> tags)
+ public bool HasAllTags(TagComponent component, [ForbidLiteral] List<ProtoId<TagPrototype>> tags)
{
foreach (var tag in tags)
{
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool HasAllTags(TagComponent component, HashSet<ProtoId<TagPrototype>> tags)
+ public bool HasAllTags(TagComponent component, [ForbidLiteral] HashSet<ProtoId<TagPrototype>> tags)
{
foreach (var tag in tags)
{
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool HasAllTags(TagComponent component, IEnumerable<ProtoId<TagPrototype>> tags)
+ public bool HasAllTags(TagComponent component, [ForbidLiteral] IEnumerable<ProtoId<TagPrototype>> tags)
{
foreach (var tag in tags)
{
/// <exception cref="UnknownPrototypeException">
/// Thrown if no <see cref="TagPrototype"/> exists with the given id.
/// </exception>
- public bool HasAnyTag(TagComponent component, ProtoId<TagPrototype> tag) =>
+ public bool HasAnyTag(TagComponent component, [ForbidLiteral] ProtoId<TagPrototype> tag) =>
HasTag(component, tag);
/// <summary>
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool HasAnyTag(TagComponent component, params ProtoId<TagPrototype>[] tags)
+ public bool HasAnyTag(TagComponent component, [ForbidLiteral] params ProtoId<TagPrototype>[] tags)
{
foreach (var tag in tags)
{
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool HasAnyTag(TagComponent component, HashSet<ProtoId<TagPrototype>> tags)
+ public bool HasAnyTag(TagComponent component, [ForbidLiteral] HashSet<ProtoId<TagPrototype>> tags)
{
foreach (var tag in tags)
{
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool HasAnyTag(TagComponent component, List<ProtoId<TagPrototype>> tags)
+ public bool HasAnyTag(TagComponent component, [ForbidLiteral] List<ProtoId<TagPrototype>> tags)
{
foreach (var tag in tags)
{
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool HasAnyTag(TagComponent component, IEnumerable<ProtoId<TagPrototype>> tags)
+ public bool HasAnyTag(TagComponent component, [ForbidLiteral] IEnumerable<ProtoId<TagPrototype>> tags)
{
foreach (var tag in tags)
{
/// <exception cref="UnknownPrototypeException">
/// Thrown if no <see cref="TagPrototype"/> exists with the given id.
/// </exception>
- public bool RemoveTag(EntityUid entityUid, ProtoId<TagPrototype> tag)
+ public bool RemoveTag(EntityUid entityUid, [ForbidLiteral] ProtoId<TagPrototype> tag)
{
return _tagQuery.TryComp(entityUid, out var component) &&
RemoveTag((entityUid, component), tag);
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool RemoveTags(EntityUid entityUid, params ProtoId<TagPrototype>[] tags)
+ public bool RemoveTags(EntityUid entityUid, [ForbidLiteral] params ProtoId<TagPrototype>[] tags)
{
return RemoveTags(entityUid, (IEnumerable<ProtoId<TagPrototype>>)tags);
}
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool RemoveTags(EntityUid entityUid, IEnumerable<ProtoId<TagPrototype>> tags)
+ public bool RemoveTags(EntityUid entityUid, [ForbidLiteral] IEnumerable<ProtoId<TagPrototype>> tags)
{
return _tagQuery.TryComp(entityUid, out var component) &&
RemoveTags((entityUid, component), tags);
/// <exception cref="UnknownPrototypeException">
/// Thrown if no <see cref="TagPrototype"/> exists with the given id.
/// </exception>
- public bool AddTag(Entity<TagComponent> entity, ProtoId<TagPrototype> tag)
+ public bool AddTag(Entity<TagComponent> entity, [ForbidLiteral] ProtoId<TagPrototype> tag)
{
#if DEBUG
AssertValidTag(tag);
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool AddTags(Entity<TagComponent> entity, params ProtoId<TagPrototype>[] tags)
+ public bool AddTags(Entity<TagComponent> entity, [ForbidLiteral] params ProtoId<TagPrototype>[] tags)
{
return AddTags(entity, (IEnumerable<ProtoId<TagPrototype>>)tags);
}
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool AddTags(Entity<TagComponent> entity, IEnumerable<ProtoId<TagPrototype>> tags)
+ public bool AddTags(Entity<TagComponent> entity, [ForbidLiteral] IEnumerable<ProtoId<TagPrototype>> tags)
{
var update = false;
foreach (var tag in tags)
/// <exception cref="UnknownPrototypeException">
/// Thrown if no <see cref="TagPrototype"/> exists with the given id.
/// </exception>
- public bool RemoveTag(Entity<TagComponent> entity, ProtoId<TagPrototype> tag)
+ public bool RemoveTag(Entity<TagComponent> entity, [ForbidLiteral] ProtoId<TagPrototype> tag)
{
#if DEBUG
AssertValidTag(tag);
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool RemoveTags(Entity<TagComponent> entity, params ProtoId<TagPrototype>[] tags)
+ public bool RemoveTags(Entity<TagComponent> entity, [ForbidLiteral] params ProtoId<TagPrototype>[] tags)
{
return RemoveTags(entity, (IEnumerable<ProtoId<TagPrototype>>)tags);
}
/// <exception cref="UnknownPrototypeException">
/// Thrown if one of the ids represents an unregistered <see cref="TagPrototype"/>.
/// </exception>
- public bool RemoveTags(Entity<TagComponent> entity, IEnumerable<ProtoId<TagPrototype>> tags)
+ public bool RemoveTags(Entity<TagComponent> entity, [ForbidLiteral] IEnumerable<ProtoId<TagPrototype>> tags)
{
var update = false;
foreach (var tag in tags)