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;
305 void moveEnv(@NotNull G gameObject, @NotNull Point pos, @NotNull G nextGameObject);
385 boolean isAreaEmpty(
int left,
int top,
int width,
int height);
451 void nextPoint(Point point,
int direction);
int getTransactionDepth()
Get the transaction depth, which is the number of beginTransaction(String) invocations without matchi...
boolean isMultiArchFittingToMap(@NotNull Archetype< G, A, R > archetype, @NotNull Point pos, boolean allowDouble)
Checks whether an GameObject (multi-arch) would still fit on this map.
void removeMapTransactionListener(@NotNull MapTransactionListener< G, A, R > listener)
Unregisters a map transaction listener.
Exception thrown if the destination path points to the source map.
void addActiveEditType(int editType)
Add edit type to the bitmask of active types.
A MapModel reflects the data of a map.
void setErrors(@NotNull ErrorCollector< G, A, R > errors)
Sets the errors in this map.
This package contains the framework for validating maps.
void endTransaction()
End a transaction.
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 endSquareChange(@NotNull MapSquare< G, A, R > mapSquare)
Method to notify the model that a map square was changed.
void removeGameObject(@NotNull G gameObject, boolean join)
Delete an existing GameObject from the map.
void nextPoint(Point point, int direction)
Moves the given point forward or backward one map square.
boolean isModified()
Return whether the map has been modified from the on-disk state.
Represents a maps directory local map path.
void clearMap()
Clears this map completely.
void addMapModelListener(@NotNull MapModelListener< G, A, R > listener)
Register a map listener.
G insertBaseObject(@NotNull BaseObject< G, A, R, ?> baseObject, @NotNull Point pos, boolean allowMany, boolean join, @NotNull InsertionMode< G, A, R > insertionMode)
Inserts a BaseObject to a map.
Base package of all Gridarta classes.
void addGameObjectToMap(@NotNull G gameObject, @NotNull Point pos, @NotNull InsertionMode< G, A, R > insertionMode)
Add a gameObject to the map.
Reflects a game object (object on a map).
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.
GameObjects are the objects based on Archetypes found on maps.
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 addObjectListToMap(@NotNull Iterable< G > objects)
Adds a list of GameObjects to this map.
void moveInv(@NotNull G gameObject, @NotNull GameObject< G, A, R > prevGameObject)
Moves a GameObject to the inventory of another game object.
void removeMapModelListener(@NotNull MapModelListener< G, A, R > listener)
Unregister a map listener.
void beginSquareChange(@NotNull MapSquare< G, A, R > mapSquare)
Method to notify the model that a map square is about to change.
void mapClosed()
This function must be called if this instance is freed.
void moveEnv(@NotNull G gameObject, @NotNull Point pos, @NotNull G nextGameObject)
Moves a GameObject to its environment.
void endAllTransactions()
Ends all transaction.
A getMapArchObject()
Returns the Map Arch Object with the meta information about the map.
Exception thrown if an operation is attempted on an unsaved map.
void resetModified()
Resets the modified flag to false.
MapFile getMapFile()
Returns the map file.
void beginGameObjectChange(@NotNull G gameObject)
Method to notify the model that a game object is about to change.
An interface for classes that collect errors.
void endGameObjectChange(@NotNull G gameObject)
Method to notify the model that a game object was changed.
boolean isAreaEmpty(int left, int top, int width, int height)
Checks whether an area of a map is completely empty.
boolean isAnyTransactionActive()
Returns whether a transaction is currently active.
boolean isEmpty()
Returns whether the map is empty.
void beginTransaction(@NotNull String name)
Starts a new transaction.
void setMapFile(@Nullable MapFile mapFile)
Sets the map file.
ErrorCollector< G, A, R > getErrors()
Gets the errors in this map.
List< G > getAllGameObjects()
Returns all game objects.
void facesReloaded()
Will be called whenever the archetype faces have been reloaded.
The location of a map file with a map directory.
Interface for MapArchObjects.