Struct ComplexTagCondition<TTagSet>
- Namespace
- Vintagestory.API.Datastructures
- Assembly
- VintagestoryAPI.dll
Holds a complex tag condition, either as a set of disjunctive entries ([a and b and c] or [d and e])
or as a set of conjunctive entries ([a or b or c] and [d or e]).
In both cases each of the inner sets can also have a set of forbidden tags that is always disjunctive.
The syntax for using these in json follows one simple rule: If no junction verb is specified, the group is treated as conjunctive (a and b and c)
["all", "of", "these"]
[["all", "of", "these"]]
[["all", "of", "these"], (or) { allOf: ["all", "of", "these"], noneOf: ["any", "of", "these"] }]
{ allOf: ["all", "of", "these"], noneOf: ["any", "of", "these"] }
{ anyOf: ["any", "of", "these"], noneOf: ["any", "of", "these"] }
{ anyOf: [["all", "of", "these"], { allOf: ["all", "of", "these"], noneOf: ["any", "of", "these"] }] }
{ allOf: [["anyOf", "of", "these"], (and) { anyOf: ["any", "of", "these"], noneOf: ["any", "of", "these"] }] }
[JsonConverter(typeof(GenericComplexConditionConverter))]
public struct ComplexTagCondition<TTagSet> : IEquatable<ComplexTagCondition<TTagSet>> where TTagSet : IEquatable<TTagSet>
Type Parameters
TTagSet
- Implements
-
IEquatable<ComplexTagCondition<TTagSet>>
- Inherited Members
- Extension Methods
Remarks
You cannot mix junction verbs on the same layer.
Fields
conditions
public ComplexTagCondition<TTagSet>.Condition[]? conditions
Field Value
isDisjunctive
public bool isDisjunctive
Field Value
Properties
IsEmpty
[MemberNotNullWhen(false, "conditions")]
public readonly bool IsEmpty { get; }
Property Value
Methods
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override readonly bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
Equals(ComplexTagCondition<TTagSet>)
Indicates whether the current object is equal to another object of the same type.
public readonly bool Equals(ComplexTagCondition<TTagSet> other)
Parameters
otherComplexTagCondition<TTagSet>An object to compare with this object.
Returns
GetHashCode()
Returns the hash code for this instance.
public override readonly int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Returns the fully qualified type name of this instance.
public override readonly string ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(in ComplexTagCondition<TTagSet>, in ComplexTagCondition<TTagSet>)
public static bool operator ==(in ComplexTagCondition<TTagSet> self, in ComplexTagCondition<TTagSet> other)
Parameters
selfComplexTagCondition<TTagSet>otherComplexTagCondition<TTagSet>
Returns
operator !=(in ComplexTagCondition<TTagSet>, in ComplexTagCondition<TTagSet>)
public static bool operator !=(in ComplexTagCondition<TTagSet> self, in ComplexTagCondition<TTagSet> other)
Parameters
selfComplexTagCondition<TTagSet>otherComplexTagCondition<TTagSet>