Class PluginModel<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<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>>
    • Method Detail

      • getPlugin

        @Nullable
        public @Nullable Plugin<G,​A,​R> getPlugin​(@NotNull
                                                             @NotNull java.lang.String name)
      • getPluginCount

        public int getPluginCount()
      • getPlugin

        @Nullable
        public @Nullable Plugin<G,​A,​R> getPlugin​(int index)
      • addPlugin

        public boolean addPlugin​(@NotNull
                                 @NotNull Plugin<G,​A,​R> plugin)
        Add a new plugin.
        Parameters:
        plugin - the plugin to add
        Returns:
        true if the plugin was added, or false if the plugin name already exists
      • addPlugin

        public void addPlugin​(@NotNull
                              @NotNull java.io.File file)
      • removePlugin

        public void removePlugin​(@NotNull
                                 @NotNull Plugin<G,​A,​R> plugin)
      • savePlugin

        public void savePlugin​(@NotNull
                               @NotNull Plugin<G,​A,​R> plugin,
                               @NotNull
                               @NotNull java.io.File file)
                        throws java.io.IOException
        Saves a plugin to a given file.
        Parameters:
        plugin - the plugin to save
        file - 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:
        iterator in interface java.lang.Iterable<G extends GameObject<G,​A,​R>>
      • reRegister

        public void reRegister​(@NotNull
                               @NotNull Plugin<G,​A,​R> plugin)
      • newPlugin

        @Nullable
        public @Nullable Plugin<G,​A,​R> newPlugin​(@NotNull
                                                             @NotNull java.lang.String name,
                                                             @NotNull
                                                             @NotNull java.lang.String code)