Game Development Reference
In-Depth Information
}
public double Operation(double left, double right)
{
return left - right;
}
}
}
Note
You may have noticed that the class is decorated with Plugin instead of PluginAttribute . It is
optional to append the Attribute text when decorating a class with an attribute.
The following code shows the PluginAttribute decoration. It would be very easy to
add to this attribute over time if there is additional information you want to be
embedded with each plugin.
namespace Plugin.API
{
[AttributeUsage(AttributeTargets.Class)]
public class PluginAttribute : Attribute
{
private string component = string.Empty;
private string description = string.Empty;
public string Component
{
get { return component; }
set { component = value; }
}
public string Description
{
get { return description; }
set { description = value; }
}
}
}
The PluginAttribute decoration should be located in the same assembly as the
IPlugin interface.
 
Search Nedrilad ::




Custom Search