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(PickmapState<G,A,R> pickmapState)
Adds a map file.
|
void |
addPickmapChooserListener(PickmapChooserModelListener<G,A,R> pickmapChooserModelListener)
Adds a
PickmapChooserModelListener to be notified. |
void |
clear()
Removes all map files.
|
void |
fireActivePickmapChanged(PickmapState<G,A,R> pickmapState)
Notifies all listeners that the active pickmap has changes.
|
PickmapState<G,A,R> |
get(int index)
Returns a map file by index.
|
PickmapState<G,A,R> |
getPickmap(java.io.File file)
Returns the pickmap by file name.
|
int |
indexOf(PickmapState<G,A,R> pickmapState)
Returns the index of a map file.
|
boolean |
isEmpty()
Returns whether no pickmaps exist in the current folder.
|
java.util.Iterator<PickmapState<G,A,R>> |
iterator() |
int |
removeMapFile(PickmapState<G,A,R> pickmapState)
Removes a map file.
|
int |
revertMapFile(MapControl<G,A,R> oldPickmap,
PickmapState<G,A,R> pickmapState)
Reverts a map file.
|
public int addMapFile(@NotNull PickmapState<G,A,R> pickmapState)
pickmapState
- the map file to addpublic int removeMapFile(@NotNull PickmapState<G,A,R> pickmapState)
pickmapState
- the map file to remove-1
if the map file does not existpublic int revertMapFile(@NotNull MapControl<G,A,R> oldPickmap, @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 PickmapState<G,A,R> getPickmap(@NotNull java.io.File file)
file
- the file namenull
if the file is unknownpublic boolean isEmpty()
public int indexOf(@NotNull PickmapState<G,A,R> pickmapState)
pickmapState
- the map file to search-1
if the map file does not exist@NotNull public 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 PickmapState<G,A,R> get(int index)
index
- the indexpublic void clear()
public void addPickmapChooserListener(@NotNull PickmapChooserModelListener<G,A,R> pickmapChooserModelListener)
PickmapChooserModelListener
to be notified.pickmapChooserModelListener
- the listener to addpublic void fireActivePickmapChanged(@Nullable PickmapState<G,A,R> pickmapState)
pickmapState
- the active pickmap