de.adom.jade.world.tiles
Class Tile

java.lang.Object
  extended by de.adom.jade.world.tiles.Tile
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
GrassTile, OutdoorExitTile, ResistantWallTile, StairDownTile, StairUpTile, VortexTile, WallTile

public class Tile
extends java.lang.Object
implements java.io.Serializable

Defines a series of constants that represent all tiles a map can contain. Each constant provides a ot of useful information about its special abilities due to a number of mehods.

See Also:
Serialized Form

Field Summary
static Tile DEEP_SEA
          the deep water tile
static Tile DESERT
          the desert tile
static Tile DUMMY_RIVER
          a dummy river tile for use during river placement
static Tile DUNGEON
          the dungeon tile
static Tile FLOOR
          the floor tile
static Tile FOREST
          the forest tile
static Tile GRASS
          the grass tile
static Tile HIGH_MOUNTAIN
          the high mountain tile
static Tile HILLS
          the hill tile
static Tile LOW_MOUNTAIN
          the low mountain tile
static Tile MOUNTAIN
          the mountain tile
static Tile OUTDOOR_EXIT
          the tunnel tile
static Tile PLAINS
          the plains tile
static Tile RESISTANT_WALL
          the resistant wall tile (can't be penetrated by anything and thus serves as a boundary)
static Tile RIVER
          the river tile
static Tile RIVER_SOURCE
          the river source tile
static Tile SEA
          the water tile
static Tile SETTLEMENT
          the town tile
static Tile STAIR_DOWN
          the tunnel tile
static Tile STAIR_UP
          the tunnel tile
static Tile SWAMP
          the swamp tile
static Tile TREE
          the tree tile
static Tile TUNNEL
          the tunnel tile
static Tile UNKNOWN
          an undefined tile for uninitialized map pieces
static Tile VOLCANOE
          the volvanoe tile
static Tile VORTEX
          the tunnel tile
static Tile WALL
          the wall tile
static Tile WATER
          the water tile
 
Constructor Summary
Tile(java.lang.String aName, boolean openness, int vBlock)
          Defines a new tile.
 
Method Summary
 void executeActionAfterEnteringOn(Being being)
          Executes an action on the being after the being successfully entered a tile.
 int getID()
          Returns the ID of the tile.
 java.lang.String getName()
          Returns the unqiue logical name of the tile.
static int getNumberOfTiles()
          Returns the total number of tiles.
static java.util.Iterator getTileIterator()
          Returns an iterator iterating all the tiles in the game.
 int getVisibilityBlockadeLevel()
          Returns the blocking level of this tile as far as visibility is concerned.
 boolean isEnteredBy(Being being)
          Determines whether a being manages to enter this particular tile.
 boolean isOpen()
          Determines whether this tile is open for passage by solid beings or not.
 boolean isOpenFor(Being being)
          Determines whether this tile is open for passage by a specific being or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN

public static final Tile UNKNOWN
an undefined tile for uninitialized map pieces


HIGH_MOUNTAIN

public static final Tile HIGH_MOUNTAIN
the high mountain tile


VOLCANOE

public static final Tile VOLCANOE
the volvanoe tile


MOUNTAIN

public static final Tile MOUNTAIN
the mountain tile


LOW_MOUNTAIN

public static final Tile LOW_MOUNTAIN
the low mountain tile


HILLS

public static final Tile HILLS
the hill tile


FOREST

public static final Tile FOREST
the forest tile


DESERT

public static final Tile DESERT
the desert tile


PLAINS

public static final Tile PLAINS
the plains tile


DEEP_SEA

public static final Tile DEEP_SEA
the deep water tile


SEA

public static final Tile SEA
the water tile


DUMMY_RIVER

public static final Tile DUMMY_RIVER
a dummy river tile for use during river placement


RIVER

public static final Tile RIVER
the river tile


RIVER_SOURCE

public static final Tile RIVER_SOURCE
the river source tile


SWAMP

public static final Tile SWAMP
the swamp tile


SETTLEMENT

public static final Tile SETTLEMENT
the town tile


DUNGEON

public static final Tile DUNGEON
the dungeon tile


WALL

public static final Tile WALL
the wall tile


TUNNEL

public static final Tile TUNNEL
the tunnel tile


VORTEX

public static final Tile VORTEX
the tunnel tile


STAIR_UP

public static final Tile STAIR_UP
the tunnel tile


STAIR_DOWN

public static final Tile STAIR_DOWN
the tunnel tile


RESISTANT_WALL

public static final Tile RESISTANT_WALL
the resistant wall tile (can't be penetrated by anything and thus serves as a boundary)


GRASS

public static final Tile GRASS
the grass tile


OUTDOOR_EXIT

public static final Tile OUTDOOR_EXIT
the tunnel tile


WATER

public static final Tile WATER
the water tile


TREE

public static final Tile TREE
the tree tile


FLOOR

public static final Tile FLOOR
the floor tile

Constructor Detail

Tile

public Tile(java.lang.String aName,
            boolean openness,
            int vBlock)
Defines a new tile.

Parameters:
aName - the unique name for the tile
openness - a boolean value determining whether this tile is open or not
vBlock - the blocking level for visibility
Method Detail

getID

public int getID()
Returns the ID of the tile. This ID is unique per game session.

Returns:
the ID of this tile

getName

public java.lang.String getName()
Returns the unqiue logical name of the tile.

Returns:
the unique name of this tile

isOpen

public boolean isOpen()
Determines whether this tile is open for passage by solid beings or not. Even if the tile is potentually open, additional conditions might get checked to see if the being can really pass (e.g. the presence of a ship).

Returns:
a boolean value determing whether this tile is open for passage by solid beings or not

isOpenFor

public boolean isOpenFor(Being being)
Determines whether this tile is open for passage by a specific being or not.

Parameters:
being - the being to check
Returns:
a boolean value determing whether this tile is open for passage by a being or not

getVisibilityBlockadeLevel

public int getVisibilityBlockadeLevel()
Returns the blocking level of this tile as far as visibility is concerned.

Returns:
the blocking level for visibility

getNumberOfTiles

public static final int getNumberOfTiles()
Returns the total number of tiles.

Returns:
the total number of tiles

getTileIterator

public static java.util.Iterator getTileIterator()
Returns an iterator iterating all the tiles in the game.

Returns:
an iterator over all existing tiles

isEnteredBy

public boolean isEnteredBy(Being being)
Determines whether a being manages to enter this particular tile.

Parameters:
being - the being trying to enter this tile
Returns:
a boolean value indicating whether the being managed to enter the tile in question

executeActionAfterEnteringOn

public void executeActionAfterEnteringOn(Being being)
Executes an action on the being after the being successfully entered a tile. By default nothing happens.

Parameters:
being - the being that entered the tile