Package net.sf.gridarta.actions
Class AbstractServerActions<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.actions.AbstractServerActions<G,A,R>
-
- All Implemented Interfaces:
MapViewManagerListener<G,A,R>,EditorAction
- Direct Known Subclasses:
AtrinikServerActions
public abstract class AbstractServerActions<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements EditorAction, MapViewManagerListener<G,A,R>
Actions that require a connection to a game server.- No Inspection:
- AbstractClassWithOnlyOneDirectInheritor
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractServerActions(@NotNull FileControl<G,A,R> fileControl)Creates a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidactiveMapViewChanged(@Nullable MapView<G,A,R> mapView)This event handler is called when the current map view has changed.voidmapViewClosing(@NotNull MapView<G,A,R> mapView)This event handler is called when a map view is to be closed.voidmapViewCreated(@NotNull MapView<G,A,R> mapView)This event handler is called when a map view was created.voidopenInClient()Action method for "open in client".protected abstract voidresetMap(@NotNull java.lang.String mapPath)Resets a map identified by the given map path.voidsetAction(@NotNull javax.swing.Action action, @NotNull java.lang.String name)Sets theActioninstance for this editor action.protected abstract voidteleportCharacterToMap(@NotNull java.lang.String mapPath, int mapX, int mapY)Teleports the character to the given map path.
-
-
-
Constructor Detail
-
AbstractServerActions
protected AbstractServerActions(@NotNull @NotNull FileControl<G,A,R> fileControl)Creates a new instance.- Parameters:
fileControl- the file control for saving maps
-
-
Method Detail
-
openInClient
@ActionMethod public void openInClient()
Action method for "open in client".
-
resetMap
protected abstract void resetMap(@NotNull @NotNull java.lang.String mapPath) throws java.io.IOExceptionResets a map identified by the given map path.- Parameters:
mapPath- the map path to reset- Throws:
java.io.IOException- if reset fails
-
teleportCharacterToMap
protected abstract void teleportCharacterToMap(@NotNull @NotNull java.lang.String mapPath, int mapX, int mapY) throws java.io.IOExceptionTeleports the character to the given map path.- Parameters:
mapPath- the map path to teleport tomapX- the x coordinate to teleport tomapY- the y coordinate to teleport to- Throws:
java.io.IOException- if teleportation fails
-
setAction
public void setAction(@NotNull @NotNull javax.swing.Action action, @NotNull @NotNull java.lang.String name)Description copied from interface:EditorActionSets theActioninstance for this editor action.- Specified by:
setActionin interfaceEditorAction- Parameters:
action- the action instancename- the name of the action
-
activeMapViewChanged
public void activeMapViewChanged(@Nullable @Nullable MapView<G,A,R> mapView)Description copied from interface:MapViewManagerListenerThis event handler is called when the current map view has changed.- Specified by:
activeMapViewChangedin interfaceMapViewManagerListener<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>- Parameters:
mapView- the new map view ornullif no opened map view exists
-
mapViewCreated
public void mapViewCreated(@NotNull @NotNull MapView<G,A,R> mapView)Description copied from interface:MapViewManagerListenerThis event handler is called when a map view was created.- Specified by:
mapViewCreatedin interfaceMapViewManagerListener<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>- Parameters:
mapView- the created map view- No Inspection:
- NoopMethodInAbstractClass
-
mapViewClosing
public void mapViewClosing(@NotNull @NotNull MapView<G,A,R> mapView)Description copied from interface:MapViewManagerListenerThis event handler is called when a map view is to be closed.- Specified by:
mapViewClosingin interfaceMapViewManagerListener<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>- Parameters:
mapView- the map view that is to be closed- No Inspection:
- NoopMethodInAbstractClass
-
-