mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-08 01:04:56 +00:00
Updated Plugins (markdown)
14
Plugins.md
14
Plugins.md
@@ -14,13 +14,18 @@ All plugin assemblies must contain a static method called LoadPlugin():
|
||||
``` csharp
|
||||
public class SomeDevice : Device , IBridge //IBridge only needs to be implemented if
|
||||
{
|
||||
// This string is used to define the minimum version of the Essentials Framework required for this plugin
|
||||
// This string is used to define the minimum version of the Essentials Framework
|
||||
// required for this plugin
|
||||
public static string MinimumEssentialsFrameworkVersion = "1.4.23";
|
||||
|
||||
// This method gets called by the Essentials Framework when the application starts. It is intended to be used to load the new Device type(s) specified in the plugin
|
||||
// This method gets called by the Essentials Framework when the application starts.
|
||||
// It is intended to be used to load the new Device type(s) specified in the plugin
|
||||
public static void LoadPlugin()
|
||||
{
|
||||
DeviceFactory.AddFactoryForType("typeName", FactoryMethod); // typeName should be the unique string that identifies the type of device to build, FactoryMethod represents the method that takes a DevicConfig object as and argument and returns an instance of the desired device type
|
||||
DeviceFactory.AddFactoryForType("typeName", FactoryMethod);
|
||||
// typeName should be the unique string that identifies the type of device to build,
|
||||
// FactoryMethod represents the method that takes a DevicConfig object as and argument
|
||||
// and returns an instance of the desired device type
|
||||
}
|
||||
|
||||
// This is a factory method to construct a device and return it to be added to the DeviceManager
|
||||
@@ -30,7 +35,8 @@ public class SomeDevice : Device , IBridge //IBridge only needs to be implement
|
||||
}
|
||||
|
||||
#region IBridge
|
||||
// This method is called by an EiscApi bridge instance and should call an extension method defined in your plugin. Required for implementing IBridge
|
||||
// This method is called by an EiscApi bridge instance and should call an extension method
|
||||
// defined in your plugin. Required for implementing IBridge
|
||||
public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
this.LinkToApiExt(trilist, joinStart, joinMapKey);
|
||||
|
||||
Reference in New Issue
Block a user