Package net.sf.gridarta.model.mapcontrol
Interface MapControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
- All Known Implementing Classes:
DefaultMapControl
public interface MapControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>Currently nothing more than a marker interface for unification.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidacquire()Increases the use counter.voidaddMapControlListener(@NotNull MapControlListener<G,A,R> listener)Registers aMapControlListener.@NotNull MapModel<G,A,R>getMapModel()Returns the map model.intgetUseCounter()Returns the use counter.booleanisPickmap()Return flag that indicates whether this is a pickmap or not.voidrelease()Decreases the use counter and possibly frees the map control.voidremoveMapControlListener(@NotNull MapControlListener<G,A,R> listener)Unregisters aMapControlListener.voidsave()Saves the map to a file.voidsaveAs(@NotNull MapFile mapFile)Saves the file with the given map file.
-
-
-
Method Detail
-
isPickmap
boolean isPickmap()
Return flag that indicates whether this is a pickmap or not.- Returns:
- flag that indicates whether this is a pickmap or not
-
getMapModel
@NotNull @NotNull MapModel<G,A,R> getMapModel()
Returns the map model.- Returns:
- the map model
-
addMapControlListener
void addMapControlListener(@NotNull @NotNull MapControlListener<G,A,R> listener)Registers aMapControlListener.- Parameters:
listener- the listener to register
-
removeMapControlListener
void removeMapControlListener(@NotNull @NotNull MapControlListener<G,A,R> listener)Unregisters aMapControlListener.- Parameters:
listener- the listener to unregister
-
save
void save() throws java.io.IOException
Saves the map to a file.- Throws:
java.io.IOException- if saving fails
-
saveAs
void saveAs(@NotNull @NotNull MapFile mapFile) throws java.io.IOExceptionSaves the file with the given map file. This implicitly sets the map file and resets the modified state.- Parameters:
mapFile- the map file to be saved to- Throws:
java.io.IOException- if saving fails; in this case the modified flag is not reset
-
acquire
void acquire()
Increases the use counter.
-
release
void release()
Decreases the use counter and possibly frees the map control.
-
getUseCounter
int getUseCounter()
Returns the use counter.- Returns:
- the use counter
-
-