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(MapArchObjectListener listener)
Registers an event listener.
|
void |
addText(java.lang.String text)
Appends 'text' to the map text.
|
void |
beginTransaction()
Starts a new transaction.
|
java.lang.String |
calculateTilePath(Direction direction,
MapFile mapFile)
Calculate a single tile path in a particular direction.
|
void |
calculateTilePaths(MapFile mapFile,
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.
|
java.awt.Point |
getEnter()
Returns the enter coordinates.
|
int |
getEnterX()
Returns the enter x coordinate.
|
int |
getEnterY()
Returns the enter y coordinate.
|
java.lang.String |
getMapName()
Returns the map name.
|
Size2D |
getMapSize()
Returns the map size.
|
int |
getResetTimeout()
Returns the reset timeout (in seconds).
|
int |
getSwapTime()
Returns the swap time (in ticks).
|
java.lang.String |
getText()
Returns the message text.
|
java.lang.String |
getTilePath(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(java.awt.Point pos)
Checks whether the given coordinate is within map bounds.
|
boolean |
isTilePathAuto(Direction direction,
MapFile mapFile)
Determines whether a tiled map in the specified direction is automatic
tiled path or not.
|
void |
removeMapArchObjectListener(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(java.lang.String name)
Sets the map name.
|
void |
setMapSize(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(Direction direction,
java.lang.String tilePath)
Sets a tile path.
|
void |
updateModifiedAttribute(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 Size2D mapSize)
mapSize
- the new map size@NotNull Size2D getMapSize()
@NotNull java.lang.String getMapName()
void setMapName(@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 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 java.lang.String getTilePath(@NotNull Direction direction)
direction
- the tile path directionvoid setTilePath(@NotNull Direction direction, @NotNull java.lang.String tilePath)
direction
- the tile path directiontilePath
- the new tile path@NotNull java.lang.String calculateTilePath(@NotNull Direction direction, @Nullable MapFile mapFile)
direction
- the directionmapFile
- map filevoid calculateTilePaths(@Nullable MapFile mapFile, @NotNull java.io.File mapsDirectory)
mapFile
- map filemapsDirectory
- maps directoryboolean isTilePathAuto(@NotNull Direction direction, @Nullable MapFile mapFile)
direction
- direction of the tiled mapmapFile
- map file@NotNull A createClone()
void addMapArchObjectListener(@NotNull MapArchObjectListener listener)
listener
- the listener to registervoid removeMapArchObjectListener(@NotNull MapArchObjectListener listener)
listener
- the listener to unregistervoid beginTransaction()
endTransaction()
.
Beginning a nested transaction is a cheap operation.endTransaction()
,
endTransaction(boolean)
void endTransaction()
endTransaction(false)
.beginTransaction()
,
endTransaction(boolean)
void endTransaction(boolean fireEvent)
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 java.lang.String text)
text
- the string to addvoid setText(java.lang.String text)
text
- the new map text@NotNull java.lang.String getText()
void updateModifiedAttribute(@NotNull java.lang.String userName)
userName
- the user name to includeboolean isPointValid(@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
)