Class ConditionPayloadAttribute
- Namespace
- ElectricDrill.AstraRpgFramework.Conditions
- Assembly
- com.electricdrill.astra-rpg-framework.Runtime.dll
Declares which event-payload type a Condition subclass can consume.
Apply one or more instances to a Condition subclass to declare the payload types it supports. A condition with no attribute is considered payload-agnostic (compatible with any trigger). A condition with one or more attributes is compatible with a trigger whose PayloadType is assignable to at least one of the declared AcceptedType values.
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
public sealed class ConditionPayloadAttribute : Attribute
- Inheritance
-
objectAttributeConditionPayloadAttribute
Constructors
ConditionPayloadAttribute(Type)
Declares that the annotated Condition subclass can consume payloads
assignable to acceptedType.
public ConditionPayloadAttribute(Type acceptedType)
Parameters
acceptedTypeTypeMust not be
null. Use the absence of the attribute to express payload-agnostic semantics instead.
Exceptions
- ArgumentNullException
acceptedTypeisnull.
Properties
AcceptedType
The payload type (concrete class or interface) that the annotated condition can process.
public Type AcceptedType { get; }
Property Value
- Type