public class PickmapChooserModel<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements java.lang.Iterable<PickmapState<G,A,R>>
PickmapState instances.| Constructor and Description |
|---|
PickmapChooserModel() |
| Modifier and Type | Method and Description |
|---|---|
int |
addMapFile(@NotNull PickmapState<G,A,R> pickmapState)
Adds a map file.
|
void |
addPickmapChooserListener(@NotNull PickmapChooserModelListener<G,A,R> pickmapChooserModelListener)
Adds a
PickmapChooserModelListener to be notified. |
void |
clear()
Removes all map files.
|
void |
fireActivePickmapChanged(@Nullable PickmapState<G,A,R> pickmapState)
Notifies all listeners that the active pickmap has changes.
|
@NotNull PickmapState<G,A,R> |
get(int index)
Returns a map file by index.
|
@Nullable PickmapState<G,A,R> |
getPickmap(@NotNull java.io.File file)
Returns the pickmap by file name.
|
int |
indexOf(@NotNull PickmapState<G,A,R> pickmapState)
Returns the index of a map file.
|
boolean |
isEmpty()
Returns whether no pickmaps exist in the current folder.
|
@NotNull java.util.Iterator<PickmapState<G,A,R>> |
iterator() |
int |
removeMapFile(@NotNull PickmapState<G,A,R> pickmapState)
Removes a map file.
|
int |
revertMapFile(@NotNull MapControl<G,A,R> oldPickmap,
@NotNull PickmapState<G,A,R> pickmapState)
Reverts a map file.
|
public int addMapFile(@NotNull
@NotNull PickmapState<G,A,R> pickmapState)
pickmapState - the map file to addpublic int removeMapFile(@NotNull
@NotNull PickmapState<G,A,R> pickmapState)
pickmapState - the map file to remove-1 if the map file does not existpublic int revertMapFile(@NotNull
@NotNull MapControl<G,A,R> oldPickmap,
@NotNull
@NotNull PickmapState<G,A,R> pickmapState)
oldPickmap - the old pickmap controlpickmapState - the map file to revert-1 if the map file does not exist@Nullable public @Nullable PickmapState<G,A,R> getPickmap(@NotNull @NotNull java.io.File file)
file - the file namenull if the file is unknownpublic boolean isEmpty()
public int indexOf(@NotNull
@NotNull PickmapState<G,A,R> pickmapState)
pickmapState - the map file to search-1 if the map file does not exist@NotNull public @NotNull java.util.Iterator<PickmapState<G,A,R>> iterator()
iterator in interface java.lang.Iterable<PickmapState<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>>@NotNull public @NotNull PickmapState<G,A,R> get(int index)
index - the indexpublic void clear()
public void addPickmapChooserListener(@NotNull
@NotNull PickmapChooserModelListener<G,A,R> pickmapChooserModelListener)
PickmapChooserModelListener to be notified.pickmapChooserModelListener - the listener to addpublic void fireActivePickmapChanged(@Nullable
@Nullable PickmapState<G,A,R> pickmapState)
pickmapState - the active pickmap