Package net.sf.gridarta.plugin
Class PluginModel<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.plugin.PluginModel<G,A,R>
-
- All Implemented Interfaces:
java.lang.Iterable<Plugin<G,A,R>>
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 Summary
Constructors Constructor Description PluginModel(@NotNull PluginParameterFactory<G,A,R> pluginParameterFactory, @NotNull PluginModelParser<G,A,R> pluginModelParser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPlugin(@NotNull java.io.File file)booleanaddPlugin(@NotNull Plugin<G,A,R> plugin)Add a new plugin.voidaddPluginModelListener(@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)intgetPluginCount()@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)voidremovePlugin(@NotNull Plugin<G,A,R> plugin)voidremovePluginModelListener(@NotNull PluginModelListener<G,A,R> listener)Removes a listener to be informed of changes.voidreRegister(@NotNull Plugin<G,A,R> plugin)voidsavePlugin(@NotNull Plugin<G,A,R> plugin, @NotNull java.io.File file)Saves a plugin to a given file.
-
-
-
Constructor Detail
-
PluginModel
public PluginModel(@NotNull @NotNull PluginParameterFactory<G,A,R> pluginParameterFactory, @NotNull @NotNull PluginModelParser<G,A,R> pluginModelParser)
-
-
Method Detail
-
getPlugin
@Nullable public @Nullable Plugin<G,A,R> getPlugin(@NotNull @NotNull java.lang.String name)
-
getPluginCount
public int getPluginCount()
-
addPlugin
public boolean addPlugin(@NotNull @NotNull Plugin<G,A,R> plugin)Add a new plugin.- Parameters:
plugin- the plugin to add- Returns:
trueif the plugin was added, orfalseif the plugin name already exists
-
addPlugin
public void addPlugin(@NotNull @NotNull java.io.File file)
-
savePlugin
public void savePlugin(@NotNull @NotNull Plugin<G,A,R> plugin, @NotNull @NotNull java.io.File file) throws java.io.IOExceptionSaves a plugin to a given file.- Parameters:
plugin- the plugin to savefile- the file to save to- Throws:
java.io.IOException- if the file cannot be saved
-
addPluginModelListener
public void addPluginModelListener(@NotNull @NotNull PluginModelListener<G,A,R> listener)Adds a listener to be informed of changes.- Parameters:
listener- the listener
-
removePluginModelListener
public void removePluginModelListener(@NotNull @NotNull PluginModelListener<G,A,R> listener)Removes a listener to be informed of changes.- Parameters:
listener- the listener
-
iterator
@NotNull public @NotNull java.util.Iterator<Plugin<G,A,R>> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<G extends GameObject<G,A,R>>
-
-