|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectTurn
public class Turn
George Smith CIS421 - Web Based Java December 7th, 2007 Project: Battleship v2.0 Description: The Turn class for the battle ship game is used to store the AI information sued to attack the players ship
| Field Summary | |
|---|---|
private int |
bottomX
|
private int |
bottomY
|
private int |
counter
|
private java.lang.String |
direction
|
private int |
leftX
|
private int |
leftY
|
private int |
oX
|
private int |
oY
|
private int |
rightX
|
private int |
rightY
|
private int |
topX
|
private int |
topY
|
| Constructor Summary | |
|---|---|
Turn()
|
|
Turn(int x,
int y)
The turn class is where the values for the AI are stored and used to attack the other player |
|
| Method Summary | |
|---|---|
int |
getBottomX()
Used to get the bottom of the x |
int |
getBottomY()
Used to get the bottom y |
int |
getCount()
Used to get the count |
java.lang.String |
getDirection()
Used to get the direction for the AIattack |
int |
getLeftX()
Used to get the left of the x |
int |
getLeftY()
Used to get the left of the y |
int |
getOX()
Used to get the orignal x |
int |
getOY()
Used to get the orignal y |
int |
getRightX()
Used to get the right of the x |
int |
getRightY()
Used to get the right of the y |
int |
getTopX()
Used to get the top x |
int |
getTopY()
Used to get the top y |
void |
setBottomX(int x)
Used to set the BottomX spot |
void |
setBottomY(int y)
Used to set the BottomY spot |
void |
setCount(int c)
Used to set the count |
void |
setDirection(java.lang.String l)
Used to set the direction |
void |
setLeftX(int x)
Used to set the LeftX spot |
void |
setLeftY(int y)
Used to set the Lefty spot |
void |
setOX(int x)
Used to set the orignal spot at x |
void |
setOY(int y)
Used to set the orignal spot at y |
void |
setRightX(int x)
Used to set the RightX spot |
void |
setRightY(int y)
Used to set the RightX spot |
void |
setTopX(int x)
Used to set the TopX spot |
void |
setTopY(int y)
Used to set the TopY spot |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int rightX
private int rightY
private int leftX
private int leftY
private int bottomX
private int bottomY
private int topX
private int topY
private int oX
private int oY
private int counter
private java.lang.String direction
| Constructor Detail |
|---|
public Turn()
public Turn(int x,
int y)
x - - the orignal row coordinate of the hity - - the orignal col coordinate of the hit| Method Detail |
|---|
public void setRightX(int x)
x - - the hit of the row coordinatepublic void setRightY(int y)
y - - one minus the col coordinatepublic void setLeftX(int x)
x - - row column of hit of coordinatepublic void setLeftY(int y)
y - - one plus the col coordinatepublic void setBottomX(int x)
x - - one minus the row coordinatepublic void setBottomY(int y)
y - - one minus the col coordinatepublic void setTopX(int x)
x - - one minus the row coordinatepublic void setTopY(int y)
y - - one plus the col coordinatepublic void setOX(int x)
x - - the orignal xpublic void setOY(int y)
y - - the orignal ypublic int getRightX()
public int getRightY()
public int getLeftX()
public int getLeftY()
public int getBottomX()
public int getBottomY()
public int getTopX()
public int getTopY()
public int getOX()
public int getOY()
public void setCount(int c)
c - - used to set the counterpublic int getCount()
public void setDirection(java.lang.String l)
l - - used to set the direction of the AI attackpublic java.lang.String getDirection()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||