Class PickmapChooserModel<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>

    • Constructor Detail

      • PickmapChooserModel

        public PickmapChooserModel()
    • Method Detail

      • addMapFile

        public int addMapFile​(@NotNull
                              @NotNull PickmapState<G,​A,​R> pickmapState)
        Adds a map file.
        Parameters:
        pickmapState - the map file to add
        Returns:
        the insertion index
      • removeMapFile

        public int removeMapFile​(@NotNull
                                 @NotNull PickmapState<G,​A,​R> pickmapState)
        Removes a map file.
        Parameters:
        pickmapState - the map file to remove
        Returns:
        the removed index or -1 if the map file does not exist
      • revertMapFile

        public int revertMapFile​(@NotNull
                                 @NotNull MapControl<G,​A,​R> oldPickmap,
                                 @NotNull
                                 @NotNull PickmapState<G,​A,​R> pickmapState)
        Reverts a map file.
        Parameters:
        oldPickmap - the old pickmap control
        pickmapState - the map file to revert
        Returns:
        the reverted index or -1 if the map file does not exist
      • getPickmap

        @Nullable
        public @Nullable PickmapState<G,​A,​R> getPickmap​(@NotNull
                                                                    @NotNull java.io.File file)
        Returns the pickmap by file name.
        Parameters:
        file - the file name
        Returns:
        the pickmap, or null if the file is unknown
      • isEmpty

        public boolean isEmpty()
        Returns whether no pickmaps exist in the current folder.
        Returns:
        whether no pickmaps exist
      • indexOf

        public int indexOf​(@NotNull
                           @NotNull PickmapState<G,​A,​R> pickmapState)
        Returns the index of a map file.
        Parameters:
        pickmapState - the map file to search
        Returns:
        the index or -1 if the map file does not exist
      • iterator

        @NotNull
        public @NotNull java.util.Iterator<PickmapState<G,​A,​R>> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<G extends GameObject<G,​A,​R>>
      • get

        @NotNull
        public @NotNull PickmapState<G,​A,​R> get​(int index)
        Returns a map file by index.
        Parameters:
        index - the index
        Returns:
        the map file
      • clear

        public void clear()
        Removes all map files.
      • fireActivePickmapChanged

        public void fireActivePickmapChanged​(@Nullable
                                             @Nullable PickmapState<G,​A,​R> pickmapState)
        Notifies all listeners that the active pickmap has changes.
        Parameters:
        pickmapState - the active pickmap