|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTile
public class Tile
Each instance of this class represents one tile. The class stores information related to the tile and provides functions to modify or retrieve the information.
Field Summary | |
---|---|
(package private) int |
addedAtMoveNum
Move number that the tile was added at if it is a blank tile. |
(package private) boolean |
blankTile
true if the tile is a blank tile. |
(package private) java.lang.String |
blankTileDesc
The description for the tile if it is a blank tile. |
(package private) java.lang.String |
blankTileName
The name for the tile if it is a blank tile. |
(package private) int |
CurXPos
Current X position of the tile. |
(package private) int |
CurYPos
Current Y position of the tile. |
(package private) boolean |
Grid
true if the tile is in the Grid. |
(package private) javax.swing.ImageIcon |
img
The image used to represent the tile. |
private static long |
serialVersionUID
|
(package private) boolean |
TileBin
true if the tile is in the TileBin. |
(package private) int |
TileID
A unique tile ID that defines the tile. |
Constructor Summary | |
---|---|
Tile()
Default constructor. |
Method Summary | |
---|---|
int |
getAddedAtMoveNum()
Returns the move number at which the tile was added. |
java.lang.String |
getBlankTileDesc()
Returns the tile description. |
java.lang.String |
getBlankTileName()
Returns the tile name. |
javax.swing.ImageIcon |
getImage()
Returns the ImageIcon of the tile. |
int |
getTileID()
Returns the TileID of the tile. |
int |
getXPos()
Returns the X position of the tile. |
int |
getYPos()
Returns the Y position of the tile. |
void |
InitTile(javax.swing.ImageIcon newImage,
int x,
int y,
int id)
This function initializes a tile with an image, location, and id. |
boolean |
isBlankTile()
Returns true if the tile is a blank tile. |
boolean |
isInGrid()
Returns true if the tile is in the grid. |
boolean |
isInTileBin()
Returns true if the tile is in the tile bin. |
void |
setAddedAtMoveNum(int newNum)
Sets the move number at which the tile was added. |
void |
setBlankTileDesc(java.lang.String newDesc)
Sets the description of a blank tile. |
void |
setBlankTileName(java.lang.String newName)
Sets the name of a blank tile. |
void |
setCurPos(int x,
int y)
Sets the current position of the tile. |
void |
setImage(javax.swing.ImageIcon newImage)
Sets the image of the tile. |
void |
setToBlank()
Sets the tile to be a blank tile. |
void |
setToGrid()
Sets the tile to be in the Grid. |
void |
setToTileBin()
Sets the tile to be in the TileBin. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
int TileID
int CurXPos
int CurYPos
boolean TileBin
true
if the tile is in the TileBin.
boolean Grid
true
if the tile is in the Grid.
javax.swing.ImageIcon img
java.lang.String blankTileName
java.lang.String blankTileDesc
boolean blankTile
true
if the tile is a blank tile.
int addedAtMoveNum
Constructor Detail |
---|
public Tile()
Method Detail |
---|
public void InitTile(javax.swing.ImageIcon newImage, int x, int y, int id)
newImage
- ImageIcon to use as the tile's imagex
- The X location of the tiley
- The Y location of the tileid
- The tile ID of the tilepublic void setCurPos(int x, int y)
x
- New X position of the tiley
- New Y position of the tilepublic void setImage(javax.swing.ImageIcon newImage)
newImage
- The ImageIcon to use as the tile's image.public int getXPos()
public int getYPos()
public boolean isInTileBin()
true
if the tile is in the tile bin.
true
if the tile is in the TileBin;
false
otherwise.public boolean isInGrid()
true
if the tile is in the grid.
true
if the tile is in the Grid;
false
otherwise.public void setToTileBin()
public void setToGrid()
public int getTileID()
public javax.swing.ImageIcon getImage()
public boolean isBlankTile()
true
if the tile is a blank tile.
true
if the tile is a blank tile;
false
otherwise.public java.lang.String getBlankTileName()
public java.lang.String getBlankTileDesc()
public void setBlankTileName(java.lang.String newName)
newName
- Name to be used for the blank tile.public void setBlankTileDesc(java.lang.String newDesc)
newDesc
- Description to be used for the blank tile.public void setToBlank()
public void setAddedAtMoveNum(int newNum)
newNum
- Move number at which the tile was added.public int getAddedAtMoveNum()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |