use of nars.plugin.Plugin in project opennars by opennars.
the class PluginPanel method addPlugin.
protected void addPlugin(Class c) {
try {
Plugin p = (Plugin) c.newInstance();
nar.addPlugin(p);
} catch (Exception ex) {
JOptionPane.showMessageDialog(this, ex.toString());
}
}
use of nars.plugin.Plugin in project opennars by opennars.
the class NAR method removePlugin.
public void removePlugin(PluginState ps) {
if (plugins.remove(ps)) {
Plugin p = ps.plugin;
if (p instanceof Operator) {
memory.removeOperator((Operator) p);
}
// TODO sensory channels can be plugins
ps.setEnabled(false);
emit(Events.PluginsChange.class, null, p);
}
}