Gridarta Editor
net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A > Interface Template Reference

Interface for MapArchObjects. More...

+ Inheritance diagram for net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >:
+ Collaboration diagram for net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >:

Public Member Functions

void addMapArchObjectListener (@NotNull MapArchObjectListener listener)
 Registers an event listener. More...
 
void addText (@NotNull String text)
 Appends 'text' to the map text. More...
 
void beginTransaction ()
 Starts a new transaction. More...
 
String calculateTilePath (@NotNull Direction direction, @Nullable MapFile mapFile)
 Calculate a single tile path in a particular direction. More...
 
void calculateTilePaths (@Nullable MapFile mapFile, @NotNull File mapsDirectory)
 Calculates tiled paths for the map automatically. More...
 
createClone ()
 Creates a copy of this object. More...
 
void endTransaction ()
 Ends a transaction. More...
 
void endTransaction (boolean fireEvent)
 Ends a transaction. More...
 
int getDarkness ()
 Returns the light / darkness of this map. More...
 
int getDifficulty ()
 Returns the map's difficulty. More...
 
Point getEnter ()
 Returns the enter coordinates. More...
 
int getEnterX ()
 Returns the enter x coordinate. More...
 
int getEnterY ()
 Returns the enter y coordinate. More...
 
String getMapName ()
 Returns the map name. More...
 
Size2D getMapSize ()
 Returns the map size. More...
 
int getResetTimeout ()
 Returns the reset timeout (in seconds). More...
 
int getSwapTime ()
 Returns the swap time (in ticks). More...
 
String getText ()
 Returns the message text. More...
 
String getTilePath (@NotNull Direction direction)
 Returns a tile path. More...
 
int getTilePaths ()
 Returns the number of tile paths. More...
 
boolean isFixedReset ()
 Returns whether this map uses a fixed reset. More...
 
boolean isOutdoor ()
 Returns whether the map is an "outdoor" map. More...
 
boolean isPointValid (@Nullable Point pos)
 Checks whether the given coordinate is within map bounds. More...
 
boolean isTilePathAuto (@NotNull Direction direction, @Nullable MapFile mapFile)
 Determines whether a tiled map in the specified direction is automatic tiled path or not. More...
 
void removeMapArchObjectListener (@NotNull MapArchObjectListener listener)
 Unregisters an event listener. More...
 
void setDarkness (int darkness)
 Sets the light / darkness of this map. More...
 
void setDifficulty (int difficulty)
 Sets the map's difficulty. More...
 
void setEnterX (int enterX)
 Sets the enter x coordinate. More...
 
void setEnterY (int enterY)
 Sets the enter y coordinate. More...
 
void setFixedReset (boolean fixedReset)
 Sets whether this map uses a fixed reset. More...
 
void setMapName (@NotNull String name)
 Sets the map name. More...
 
void setMapSize (@NotNull Size2D mapSize)
 Sets the map size. More...
 
void setOutdoor (boolean outdoor)
 Sets whether the map is an "outdoor" map. More...
 
void setResetTimeout (int resetTimeout)
 Sets the reset timeout (in seconds). More...
 
void setState (@NotNull A mapArchObject)
 Resets the state of this object to the state of the given map arch object. More...
 
void setSwapTime (int swapTime)
 Sets the swap time (in ticks). More...
 
void setText (String text)
 Sets the map text. More...
 
void setTilePath (@NotNull Direction direction, @NotNull String tilePath)
 Sets a tile path. More...
 
void updateModifiedAttribute (@NotNull String userName)
 Updates the "Modified:" attribute in the message text. More...
 

Detailed Description

Interface for MapArchObjects.

Enter coordinates

Enter coordinates (getEnterX(), setEnterX(int), getEnterY(), setEnterY(int)) determines where a player enters this map from another map when using an exit.

Author
Christian Hujer
Andreas Kirschbaum

Definition at line 40 of file MapArchObject.java.

Member Function Documentation

◆ addMapArchObjectListener()

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.addMapArchObjectListener ( @NotNull MapArchObjectListener  listener)

Registers an event listener.

Parameters
listenerthe listener to register

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ addText()

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.addText ( @NotNull String  text)

Appends 'text' to the map text.

Parameters
textthe string to add

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ beginTransaction()

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.beginTransaction ( )

Starts a new transaction.

Transactions may be nested. Transactions serve the purpose of firing events to the views when more changes are known to come before the view is really required to update. Each invocation of this function requires its own invocation of endTransaction().

Beginning a nested transaction is a cheap operation.

See also
endTransaction()
endTransaction(boolean)

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

Referenced by net.sf.gridarta.actions.AttachTiledMaps< G, A, R >.updateTilePaths().

+ Here is the caller graph for this function:

◆ calculateTilePath()

String net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.calculateTilePath ( @NotNull Direction  direction,
@Nullable MapFile  mapFile 
)

Calculate a single tile path in a particular direction.

Parameters
directionthe direction
mapFilemap file
Returns
Calculated tile path, empty string on failure.

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ calculateTilePaths()

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.calculateTilePaths ( @Nullable MapFile  mapFile,
@NotNull File  mapsDirectory 
)

Calculates tiled paths for the map automatically.

Parameters
mapFilemap file
mapsDirectorymaps directory

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ createClone()

◆ endTransaction() [1/2]

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.endTransaction ( )

Ends a transaction.

Invoking this method will reduce the transaction depth by only 1.

Ending a nested operation is a cheap operation. Ending a transaction without changes also is a cheap operation.

If the last transaction is ended, the changes are committed.

Same as endTransaction(false).

See also
beginTransaction()
endTransaction(boolean)

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

Referenced by net.sf.gridarta.actions.AttachTiledMaps< G, A, R >.updateTilePaths().

+ Here is the caller graph for this function:

◆ endTransaction() [2/2]

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.endTransaction ( boolean  fireEvent)

Ends a transaction.

Invoking this method will reduce the transaction depth by only 1.

Ending a nested operation is a cheap operation. Ending a transaction without changes also is a cheap operation.

If the last transaction is ended, the changes are committed.

An example where setting

fireEvent

to

true

is useful even though the outermost transaction is not ended is when during painting the UI should be updated though painting is not finished.

Parameters
fireEvent

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ getDarkness()

Returns the light / darkness of this map.

(0 means fully bright)

Returns
the light / darkness of this map

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ getDifficulty()

◆ getEnter()

Returns the enter coordinates.

Returns
the enter coordinates

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ getEnterX()

Returns the enter x coordinate.

Returns
the enter x coordinate

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ getEnterY()

Returns the enter y coordinate.

Returns
the enter y coordinate

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ getMapName()

Returns the map name.

Returns
the map name

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ getMapSize()

◆ getResetTimeout()

int net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.getResetTimeout ( )

Returns the reset timeout (in seconds).

Returns
the reset timeout (in seconds)

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ getSwapTime()

Returns the swap time (in ticks).

Returns
the swap time (in ticks)

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ getText()

Returns the message text.

Returns
the message text

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ getTilePath()

◆ getTilePaths()

Returns the number of tile paths.

Returns
the number of tile paths

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ isFixedReset()

boolean net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.isFixedReset ( )

Returns whether this map uses a fixed reset.

Returns
whether this map uses a fixed reset

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ isOutdoor()

Returns whether the map is an "outdoor" map.

Returns
whether the map is an "outdoor" map

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ isPointValid()

◆ isTilePathAuto()

boolean net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.isTilePathAuto ( @NotNull Direction  direction,
@Nullable MapFile  mapFile 
)

Determines whether a tiled map in the specified direction is automatic tiled path or not.

Parameters
directiondirection of the tiled map
mapFilemap file
Returns
Whether the tile is automatic.

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ removeMapArchObjectListener()

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.removeMapArchObjectListener ( @NotNull MapArchObjectListener  listener)

Unregisters an event listener.

Parameters
listenerthe listener to unregister

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ setDarkness()

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.setDarkness ( int  darkness)

Sets the light / darkness of this map.

Parameters
darknessthe new light / darkness of this map

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ setDifficulty()

◆ setEnterX()

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.setEnterX ( int  enterX)

Sets the enter x coordinate.

Parameters
enterXthe new enter x coordinate

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ setEnterY()

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.setEnterY ( int  enterY)

Sets the enter y coordinate.

Parameters
enterYthe new enter y coordinate

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ setFixedReset()

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.setFixedReset ( boolean  fixedReset)

Sets whether this map uses a fixed reset.

Parameters
fixedResetwhether this map should use a fixed reset

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ setMapName()

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.setMapName ( @NotNull String  name)

Sets the map name.

Parameters
namethe new map name

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ setMapSize()

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.setMapSize ( @NotNull Size2D  mapSize)

Sets the map size.

Parameters
mapSizethe new map size this does not change the size of the underlying MapModel. We eventually should change that so a map size isn't stored twice.

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ setOutdoor()

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.setOutdoor ( boolean  outdoor)

Sets whether the map is an "outdoor" map.

Parameters
outdoorwhether the map is an "outdoor" map

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ setResetTimeout()

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.setResetTimeout ( int  resetTimeout)

Sets the reset timeout (in seconds).

Parameters
resetTimeoutthe new reset timeout (in seconds)

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ setState()

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.setState ( @NotNull A  mapArchObject)

Resets the state of this object to the state of the given map arch object.

Parameters
mapArchObjectthe map arch object to copy the state from

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ setSwapTime()

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.setSwapTime ( int  swapTime)

Sets the swap time (in ticks).

Parameters
swapTimethe swap time (in ticks)

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ setText()

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.setText ( String  text)

Sets the map text.

Parameters
textthe new map text

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.

◆ setTilePath()

◆ updateModifiedAttribute()

void net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.updateModifiedAttribute ( @NotNull String  userName)

Updates the "Modified:" attribute in the message text.

Parameters
userNamethe user name to include

Implemented in net.sf.gridarta.model.maparchobject.AbstractMapArchObject< A extends MapArchObject< A >.


The documentation for this interface was generated from the following file: