SEModCommunity / SE-Community-Mod-API

Space Engineers Community Modding API
GNU Lesser General Public License v3.0
60 stars 47 forks source link

Possiblity to create your own "PluginBase" #175

Open Spcemarine opened 9 years ago

Spcemarine commented 9 years ago

Changed PluginBase to IPlugin to make it possible to create your own PluginBase that implements IPlugin.

generalwrex commented 9 years ago

What exactly would this do? Can you go into more detail please :)

Spcemarine commented 9 years ago

Well, to detect if a class is a plugin or not the extender goes through the classes and checks if the baseclass implements IPlugin. This allows us to create our own baseclass for plugins. For example my plugins have to open database connections and since I dont want to implement each time I wrote my own baseclass like PluginBase that implements IPlugin and got an exception because it could not be cast to PluginBase. It would just be right if it is IPlugin instead of PluginBase because that is the sense of the interface, isn't it?

ghost commented 9 years ago

As a plugin author, I agree with this change.

The PluginBase class is limiting and not necessary when we can implement the IPlugin interface.