< Dice
Revision as of 19:12, 12 April 2017 by Skizzerz (talk | contribs) (Created page with "{{APIdoc|DiceFunctionAttribute Class}} An attribute that can be applied to methods which denotes the method is a valid FunctionCallback. The Dice/F...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

DiceFunctionAttribute Class

From DiceRoller Documentation

An attribute that can be applied to methods which denotes the method is a valid FunctionCallback. The FunctionRegistry.RegisterType function can be used to register types which contain methods marked with this attribute.

  • Namespace: Dice
  • Assembly: DiceRoller (in DiceRoller.dll)

Inheritance Hierarchy

System.Object

System.Attribute
Dice.DiceFunctionAttribute

Syntax

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public sealed class DiceFunctionAttribute : Attribute

Constructors

Name Description
DiceFunctionAttribute(String) Constructs a new instance of DiceFunctionAttribute

Properties

Name Description
Name Gets the name of the dice function, which is not necessarily the same as the name of the method the attribute is attached to.
Scope Gets or sets the scope of the dice function.
Timing Gets or sets the timing of the dice function.

Remarks

This attribute can be applied to a callback to mark it as a dice function. In addition to using the attribute, the type containing the decorated methods must be registered via FunctionRegistry.RegisterType. This attribute should only ever be applied to public methods whose signature matches FunctionCallback.