public interface MapArchObject<A extends MapArchObject<A>>
extends java.io.Serializable
getEnterX()
, setEnterX(int)
, getEnterY()
, setEnterY(int)
) determines where a player enters this
map from another map when using an exit.Modifier and Type | Method and Description |
---|---|
void |
addMapArchObjectListener(@NotNull MapArchObjectListener listener)
Registers an event listener.
|
void |
addText(@NotNull java.lang.String text)
Appends 'text' to the map text.
|
void |
beginTransaction()
Starts a new transaction.
|
@NotNull java.lang.String |
calculateTilePath(@NotNull Direction direction,
@Nullable MapFile mapFile)
Calculate a single tile path in a particular direction.
|
void |
calculateTilePaths(@Nullable MapFile mapFile,
@NotNull java.io.File mapsDirectory)
Calculates tiled paths for the map automatically.
|
A |
createClone()
Creates a copy of this object.
|
void |
endTransaction()
Ends a transaction.
|
void |
endTransaction(boolean fireEvent)
Ends a transaction.
|
int |
getDarkness()
Returns the light / darkness of this map.
|
int |
getDifficulty()
Returns the map's difficulty.
|
@NotNull java.awt.Point |
getEnter()
Returns the enter coordinates.
|
int |
getEnterX()
Returns the enter x coordinate.
|
int |
getEnterY()
Returns the enter y coordinate.
|
@NotNull java.lang.String |
getMapName()
Returns the map name.
|
@NotNull Size2D |
getMapSize()
Returns the map size.
|
int |
getResetTimeout()
Returns the reset timeout (in seconds).
|
int |
getSwapTime()
Returns the swap time (in ticks).
|
@NotNull java.lang.String |
getText()
Returns the message text.
|
@NotNull java.lang.String |
getTilePath(@NotNull Direction direction)
Returns a tile path.
|
int |
getTilePaths()
Returns the number of tile paths.
|
boolean |
isFixedReset()
Returns whether this map uses a fixed reset.
|
boolean |
isOutdoor()
Returns whether the map is an "outdoor" map.
|
boolean |
isPointValid(@Nullable java.awt.Point pos)
Checks whether the given coordinate is within map bounds.
|
boolean |
isTilePathAuto(@NotNull Direction direction,
@Nullable MapFile mapFile)
Determines whether a tiled map in the specified direction is automatic
tiled path or not.
|
void |
removeMapArchObjectListener(@NotNull MapArchObjectListener listener)
Unregisters an event listener.
|
void |
setDarkness(int darkness)
Sets the light / darkness of this map.
|
void |
setDifficulty(int difficulty)
Sets the map's difficulty.
|
void |
setEnterX(int enterX)
Sets the enter x coordinate.
|
void |
setEnterY(int enterY)
Sets the enter y coordinate.
|
void |
setFixedReset(boolean fixedReset)
Sets whether this map uses a fixed reset.
|
void |
setMapName(@NotNull java.lang.String name)
Sets the map name.
|
void |
setMapSize(@NotNull Size2D mapSize)
Sets the map size.
|
void |
setOutdoor(boolean outdoor)
Sets whether the map is an "outdoor" map.
|
void |
setResetTimeout(int resetTimeout)
Sets the reset timeout (in seconds).
|
void |
setState(A mapArchObject)
Resets the state of this object to the state of the given map arch
object.
|
void |
setSwapTime(int swapTime)
Sets the swap time (in ticks).
|
void |
setText(java.lang.String text)
Sets the map text.
|
void |
setTilePath(@NotNull Direction direction,
@NotNull java.lang.String tilePath)
Sets a tile path.
|
void |
updateModifiedAttribute(@NotNull java.lang.String userName)
Updates the "Modified:" attribute in the message text.
|
void setState(@NotNull A mapArchObject)
mapArchObject
- the map arch object to copy the state fromvoid setMapSize(@NotNull @NotNull Size2D mapSize)
mapSize
- the new map size@NotNull @NotNull Size2D getMapSize()
@NotNull @NotNull java.lang.String getMapName()
void setMapName(@NotNull @NotNull java.lang.String name)
name
- the new map nameint getEnterX()
void setEnterX(int enterX)
enterX
- the new enter x coordinateint getEnterY()
void setEnterY(int enterY)
enterY
- the new enter y coordinate@NotNull @NotNull java.awt.Point getEnter()
boolean isOutdoor()
void setOutdoor(boolean outdoor)
outdoor
- whether the map is an "outdoor" mapint getResetTimeout()
void setResetTimeout(int resetTimeout)
resetTimeout
- the new reset timeout (in seconds)int getSwapTime()
void setSwapTime(int swapTime)
swapTime
- the swap time (in ticks)int getDifficulty()
void setDifficulty(int difficulty)
difficulty
- the new difficulty for this mapboolean isFixedReset()
void setFixedReset(boolean fixedReset)
fixedReset
- whether this map should use a fixed resetint getDarkness()
void setDarkness(int darkness)
darkness
- the new light / darkness of this mapint getTilePaths()
@NotNull @NotNull java.lang.String getTilePath(@NotNull @NotNull Direction direction)
direction
- the tile path directionvoid setTilePath(@NotNull @NotNull Direction direction, @NotNull @NotNull java.lang.String tilePath)
direction
- the tile path directiontilePath
- the new tile path@NotNull @NotNull java.lang.String calculateTilePath(@NotNull @NotNull Direction direction, @Nullable @Nullable MapFile mapFile)
direction
- the directionmapFile
- map filevoid calculateTilePaths(@Nullable @Nullable MapFile mapFile, @NotNull @NotNull java.io.File mapsDirectory)
mapFile
- map filemapsDirectory
- maps directoryboolean isTilePathAuto(@NotNull @NotNull Direction direction, @Nullable @Nullable MapFile mapFile)
direction
- direction of the tiled mapmapFile
- map file@NotNull A createClone()
void addMapArchObjectListener(@NotNull @NotNull MapArchObjectListener listener)
listener
- the listener to registervoid removeMapArchObjectListener(@NotNull @NotNull MapArchObjectListener listener)
listener
- the listener to unregistervoid beginTransaction()
endTransaction()
.
Beginning a nested transaction is a cheap operation.
endTransaction()
,
endTransaction(boolean)
void endTransaction()
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)
.
beginTransaction()
,
endTransaction(boolean)
void endTransaction(boolean fireEvent)
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.
fireEvent
- true
if an event should be fired even in case
this doesn't end the outermost transaction.beginTransaction()
,
endTransaction()
fireEvent
is ignored
and the event is always fired., An event is never fired when there were no changes, no matter
whether the outermost transaction is ended or fireEvent
is set to
true
., If the event is fired, the internal change list is not cleared.void addText(@NotNull @NotNull java.lang.String text)
text
- the string to addvoid setText(java.lang.String text)
text
- the new map text@NotNull @NotNull java.lang.String getText()
void updateModifiedAttribute(@NotNull @NotNull java.lang.String userName)
userName
- the user name to includeboolean isPointValid(@Nullable @Nullable java.awt.Point pos)
pos
- the coordinates to checktrue
if the given coordinates are on the map, otherwise
false
(also returns false
if pos == null
)