|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJTP.Tile
public class Tile
Serves as parent for all types of tile. Most methods described here are overloaded.
Field Summary | |
---|---|
static int |
ARROW
Only allows movement in certain directions. |
static int |
GRAVITY
Exerts force on surrounding tiles |
protected int |
height
Height of this pile |
static int |
ICE
Slides to adjacent tile. |
static int |
NORMAL
A normal tile. |
static int |
TELEPORT
Teleports to another tile. |
protected int |
type
One of NORMAL , ICE , TELEPORT ,
GRAVITY or ARROW |
Constructor Summary | |
---|---|
Tile()
|
Method Summary | |
---|---|
Tile |
copy()
Creates an exact (non-shallow) copy of the current tile |
boolean |
decHeight()
Reduces height of pile by one (to at most 1). |
boolean |
equalsApartFromHeight(Tile t)
Used to compare two tiles, ignoring their respective heights. |
int |
getHeight()
Returns height of this pile. |
int |
getType()
Returns the type of tile. |
void |
incHeight()
Increases height of pile. |
boolean |
isStartable()
Specifies whether this can be a start tile. |
void |
setHeight(int height)
Sets height of tile. |
protected void |
tileCheck()
Used to check for tile attribute validity upon creation. |
protected void |
transferAttributesFrom(Tile tile)
Used to apply all attributes to this tile from another one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NORMAL
public static final int ICE
public static final int TELEPORT
public static final int GRAVITY
public static final int ARROW
protected int height
protected int type
NORMAL
, ICE
, TELEPORT
,
GRAVITY
or ARROW
Constructor Detail |
---|
public Tile()
Method Detail |
---|
protected void tileCheck() throws TileException
TileException
- if one or more attributes are invalid for a
particular tile type.protected void transferAttributesFrom(Tile tile)
tile
- the Tile
instance from which to get attributes.public int getType()
NORMAL
, ICE
,
TELEPORT
, GRAVITY
or ARROW
.public int getHeight()
int
.public boolean decHeight()
true
if the height was reduced.public void incHeight()
public void setHeight(int height)
height
- to which to set this pile to. Note: If a height below 1 is
specified the height will still be set to one.public boolean isStartable()
ICE
).
true
if this can be a start tile.public boolean equalsApartFromHeight(Tile t)
t
- the Tile
instance to compare the current tile with.
true
if the two Tile
instances
are equal disregarding their heights.public Tile copy()
Tile
instance.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |