public class CopyBuffer<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
extends java.lang.Object
Constructor and Description |
---|
CopyBuffer(MapViewSettings mapViewSettings,
GameObjectFactory<G,A,R> gameObjectFactory,
MapArchObjectFactory<A> mapArchObjectFactory,
MapModelFactory<G,A,R> mapModelFactory,
InsertionModeSet<G,A,R> insertionModeSet)
Create the copy buffer.
|
Modifier and Type | Method and Description |
---|---|
void |
addMapModelListener(MapModelListener<G,A,R> listener)
Adds a
MapModelListener to be notified about changes of the
cut/copied game objects. |
void |
clear(MapView<G,A,R> mapView,
java.awt.Rectangle selectedRec)
Executing the Clear command.
|
void |
copy(MapView<G,A,R> mapView,
java.awt.Rectangle selectedRec)
Executing the Copy command.
|
void |
cut(MapView<G,A,R> mapView,
java.awt.Rectangle selectedRec)
Executing the Cut command.
|
java.util.List<G> |
getAllGameObjects()
Return all game objects.
|
boolean |
isEmpty()
Returns whether this copy buffer contains any game objects.
|
void |
paste(MapView<G,A,R> mapView,
java.awt.Point startLocation)
Executing the Paste command.
|
void |
pasteTiled(MapView<G,A,R> mapView,
java.lang.Iterable<MapSquare<G,A,R>> selectedSquares,
java.awt.Point origin)
Executing the Paste Tiled command.
|
void |
removeMapModelListener(MapModelListener<G,A,R> listener)
Removes a
MapModelListener to be notified about changes of the
cut/copied game objects. |
public CopyBuffer(@NotNull MapViewSettings mapViewSettings, @NotNull GameObjectFactory<G,A,R> gameObjectFactory, @NotNull MapArchObjectFactory<A> mapArchObjectFactory, @NotNull MapModelFactory<G,A,R> mapModelFactory, @NotNull InsertionModeSet<G,A,R> insertionModeSet)
mapViewSettings
- the map view settings instancegameObjectFactory
- the game object factory to usemapArchObjectFactory
- the map arch object factory to usemapModelFactory
- the map model factory to useinsertionModeSet
- the insertion mode set to usepublic void addMapModelListener(@NotNull MapModelListener<G,A,R> listener)
MapModelListener
to be notified about changes of the
cut/copied game objects.listener
- the listenerpublic void removeMapModelListener(@NotNull MapModelListener<G,A,R> listener)
MapModelListener
to be notified about changes of the
cut/copied game objects.listener
- the listenerpublic void clear(@NotNull MapView<G,A,R> mapView, @NotNull java.awt.Rectangle selectedRec)
mapView
- the map view to clearselectedRec
- the rectangle to operate onpublic void cut(@NotNull MapView<G,A,R> mapView, @NotNull java.awt.Rectangle selectedRec)
mapView
- the map view to cut fromselectedRec
- the rectangle to operate onpublic void copy(@NotNull MapView<G,A,R> mapView, @NotNull java.awt.Rectangle selectedRec)
mapView
- the map view to copy fromselectedRec
- the rectangle to operate onpublic void paste(@NotNull MapView<G,A,R> mapView, @NotNull java.awt.Point startLocation)
mapView
- the map view to paste onstartLocation
- the location to paste intopublic void pasteTiled(@NotNull MapView<G,A,R> mapView, @NotNull java.lang.Iterable<MapSquare<G,A,R>> selectedSquares, @NotNull java.awt.Point origin)
mapView
- the map view to paste onselectedSquares
- the square to paste intoorigin
- the origin where to start pasting@NotNull public java.util.List<G> getAllGameObjects()
public boolean isEmpty()