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(@NotNull PluginParameterFactory<G,A,R> pluginParameterFactory,
@NotNull PluginModelParser<G,A,R> pluginModelParser) |
Modifier and Type | Method and Description |
---|---|
void |
addPlugin(@NotNull java.io.File file) |
boolean |
addPlugin(@NotNull Plugin<G,A,R> plugin)
Add a new plugin.
|
void |
addPluginModelListener(@NotNull PluginModelListener<G,A,R> listener)
Adds a listener to be informed of changes.
|
@Nullable Plugin<G,A,R> |
getPlugin(int index) |
@Nullable Plugin<G,A,R> |
getPlugin(@NotNull java.lang.String name) |
int |
getPluginCount() |
@NotNull java.util.Iterator<Plugin<G,A,R>> |
iterator() |
@Nullable Plugin<G,A,R> |
newPlugin(@NotNull java.lang.String name,
@NotNull java.lang.String code) |
void |
removePlugin(@NotNull Plugin<G,A,R> plugin) |
void |
removePluginModelListener(@NotNull PluginModelListener<G,A,R> listener)
Removes a listener to be informed of changes.
|
void |
reRegister(@NotNull Plugin<G,A,R> plugin) |
void |
savePlugin(@NotNull Plugin<G,A,R> plugin,
@NotNull java.io.File file)
Saves a plugin to a given file.
|
public PluginModel(@NotNull @NotNull PluginParameterFactory<G,A,R> pluginParameterFactory, @NotNull @NotNull PluginModelParser<G,A,R> pluginModelParser)
@Nullable public @Nullable Plugin<G,A,R> getPlugin(@NotNull @NotNull java.lang.String name)
public int getPluginCount()
public boolean addPlugin(@NotNull @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 @NotNull java.io.File file)
public void savePlugin(@NotNull @NotNull Plugin<G,A,R> plugin, @NotNull @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 @NotNull PluginModelListener<G,A,R> listener)
listener
- the listenerpublic void removePluginModelListener(@NotNull @NotNull PluginModelListener<G,A,R> listener)
listener
- the listener