public class PluginModel<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements java.lang.Iterable<Plugin<G,A,R>>
Constructor and Description |
---|
PluginModel(PluginParameterFactory<G,A,R> pluginParameterFactory,
PluginModelParser<G,A,R> pluginModelParser) |
Modifier and Type | Method and Description |
---|---|
void |
addPlugin(java.io.File file) |
boolean |
addPlugin(Plugin<G,A,R> plugin)
Add a new plugin.
|
void |
addPluginModelListener(PluginModelListener<G,A,R> listener)
Adds a listener to be informed of changes.
|
Plugin<G,A,R> |
getPlugin(int index) |
Plugin<G,A,R> |
getPlugin(java.lang.String name) |
int |
getPluginCount() |
java.util.Iterator<Plugin<G,A,R>> |
iterator() |
Plugin<G,A,R> |
newPlugin(java.lang.String name,
java.lang.String code) |
void |
removePlugin(Plugin<G,A,R> plugin) |
void |
removePluginModelListener(PluginModelListener<G,A,R> listener)
Removes a listener to be informed of changes.
|
void |
reRegister(Plugin<G,A,R> plugin) |
void |
savePlugin(Plugin<G,A,R> plugin,
java.io.File file)
Saves a plugin to a given file.
|
public PluginModel(@NotNull PluginParameterFactory<G,A,R> pluginParameterFactory, @NotNull PluginModelParser<G,A,R> pluginModelParser)
public int getPluginCount()
public boolean addPlugin(@NotNull Plugin<G,A,R> plugin)
plugin
- the plugin to addtrue
if the plugin was added, or false
if the
plugin name already existspublic void addPlugin(@NotNull java.io.File file)
public void savePlugin(@NotNull Plugin<G,A,R> plugin, @NotNull java.io.File file) throws java.io.IOException
plugin
- the plugin to savefile
- the file to save tojava.io.IOException
- if the file cannot be savedpublic void addPluginModelListener(@NotNull PluginModelListener<G,A,R> listener)
listener
- the listenerpublic void removePluginModelListener(@NotNull PluginModelListener<G,A,R> listener)
listener
- the listener