 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.model.mapmodel;
22 import java.awt.Point;
23 import java.io.Serializable;
24 import java.util.List;
30 import org.jetbrains.annotations.NotNull;
31 import org.jetbrains.annotations.Nullable;
311 void moveEnv(@NotNull G gameObject, @NotNull Point pos, @NotNull G nextGameObject);
391 boolean isAreaEmpty(
int left,
int top,
int width,
int height);
457 void nextPoint(Point point,
int direction);
G insertArchToMap(@NotNull BaseObject< G, A, R, ?> templateBaseObject, @Nullable G nextGameObject, @NotNull Point pos, boolean join)
Insert a game object to the map at a specified position.
void setErrors(@NotNull ErrorCollector< G, A, R > errors)
Sets the errors in this map.
A MapModel reflects the data of a map.
Exception thrown if the destination path points to the source map.
int getTransactionDepth()
Get the transaction depth, which is the number of {} invocations without matching { #endTransaction()...
void nextPoint(Point point, int direction)
Moves the given point forward or backward one map square.
A getMapArchObject()
Returns the Map Arch Object with the meta information about the map.
G insertBaseObject(@NotNull BaseObject< G, A, R, ?> baseObject, @NotNull Point pos, boolean allowMany, boolean join, @NotNull InsertionMode insertionMode)
Inserts a BaseObject to a map.
boolean isAnyTransactionActive()
Returns whether a transaction is currently active.
void resetModified()
Resets the modified flag to false.
boolean isEmpty()
Returns whether the map is empty.
Base package of all Gridarta classes.
void transientGameObjectChange(@NotNull G gameObject)
Method to notify the model that a game object was changed but need not be restored by undo/redo.
void endTransaction()
End a transaction.
void beginTransaction(@NotNull String name)
Starts a new transaction.
void beginSquareChange(@NotNull MapSquare< G, A, R > mapSquare)
Method to notify the model that a map square is about to change.
boolean isMultiArchFittingToMap(@NotNull Archetype< G, A, R > archetype, @NotNull Point pos, boolean allowDouble)
Checks whether a GameObject (multi-arch) would still fit on this map.
void endAllTransactions()
Ends all transaction.
void moveInv(@NotNull G gameObject, @NotNull GameObject< G, A, R > prevGameObject)
Moves a GameObject to the inventory of another game object.
void facesReloaded()
Will be called whenever the archetype faces have been reloaded.
Reflects a game object (object on a map).
void addGameObjectToMap(@NotNull G gameObject, @NotNull Point pos, @NotNull InsertionMode insertionMode)
Add a gameObject to the map.
void addMapModelListener(@NotNull MapModelListener< G, A, R > listener)
Register a map listener.
boolean isModified()
Return whether the map has been modified from the on-disk state.
void endSquareChange(@NotNull MapSquare< G, A, R > mapSquare)
Method to notify the model that a map square was changed.
ErrorCollector< G, A, R > getErrors()
Gets the errors in this map.
void beginGameObjectChange(@NotNull G gameObject)
Method to notify the model that a game object is about to change.
GameObjects are the objects based on Archetypes found on maps.
void removeMapModelListener(@NotNull MapModelListener< G, A, R > listener)
Unregister a map listener.
Interface for MapArchObjects.
void removeGameObject(@NotNull G gameObject, boolean join)
Delete an existing GameObject from the map.
void mapClosed()
This function must be called if this instance is freed.
void removeMapTransactionListener(@NotNull MapTransactionListener< G, A, R > listener)
Unregisters a map transaction listener.
An interface for classes that collect errors.
Represents a maps directory local map path.
Exception thrown if an operation is attempted on an unsaved map.
void moveEnv(@NotNull G gameObject, @NotNull Point pos, @NotNull G nextGameObject)
Moves a GameObject to its environment.
This package contains the framework for validating maps.
The location of a map file with a map directory.
void addMapTransactionListener(@NotNull MapTransactionListener< G, A, R > listener)
Registers a map transaction listener.
MapSquare< G, A, R > getMapSquare(@NotNull Point pos)
Get the square at a specified location.
void addActiveEditType(int editType)
Add edit type to the bitmask of active types.
void endGameObjectChange(@NotNull G gameObject)
Method to notify the model that a game object was changed.
void setMapFile(@Nullable MapFile mapFile)
Sets the map file.
void prependMapModelListener(@NotNull MapModelListener< G, A, R > listener)
Register a map listener and call it before all other listeners.
void clearMap()
Clears this map completely.
MapFile getMapFile()
Returns the map file.
void addObjectListToMap(@NotNull Iterable< G > objects)
Adds a list of GameObjects to this map.
boolean isAreaEmpty(int left, int top, int width, int height)
Checks whether an area of a map is completely empty.
List< G > getAllGameObjects()
Returns all game objects.