Class Turn

java.lang.Object
  extended by Turn

public class Turn
extends java.lang.Object

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

rightX

private int rightX

rightY

private int rightY

leftX

private int leftX

leftY

private int leftY

bottomX

private int bottomX

bottomY

private int bottomY

topX

private int topX

topY

private int topY

oX

private int oX

oY

private int oY

counter

private int counter

direction

private java.lang.String direction
Constructor Detail

Turn

public Turn()

Turn

public Turn(int x,
            int y)
The turn class is where the values for the AI are stored and used to attack the other player

Parameters:
x - - the orignal row coordinate of the hit
y - - the orignal col coordinate of the hit
Method Detail

setRightX

public void setRightX(int x)
Used to set the RightX spot

Parameters:
x - - the hit of the row coordinate

setRightY

public void setRightY(int y)
Used to set the RightX spot

Parameters:
y - - one minus the col coordinate

setLeftX

public void setLeftX(int x)
Used to set the LeftX spot

Parameters:
x - - row column of hit of coordinate

setLeftY

public void setLeftY(int y)
Used to set the Lefty spot

Parameters:
y - - one plus the col coordinate

setBottomX

public void setBottomX(int x)
Used to set the BottomX spot

Parameters:
x - - one minus the row coordinate

setBottomY

public void setBottomY(int y)
Used to set the BottomY spot

Parameters:
y - - one minus the col coordinate

setTopX

public void setTopX(int x)
Used to set the TopX spot

Parameters:
x - - one minus the row coordinate

setTopY

public void setTopY(int y)
Used to set the TopY spot

Parameters:
y - - one plus the col coordinate

setOX

public void setOX(int x)
Used to set the orignal spot at x

Parameters:
x - - the orignal x

setOY

public void setOY(int y)
Used to set the orignal spot at y

Parameters:
y - - the orignal y

getRightX

public int getRightX()
Used to get the right of the x

Returns:
the Right X

getRightY

public int getRightY()
Used to get the right of the y

Returns:
the Right y

getLeftX

public int getLeftX()
Used to get the left of the x

Returns:
the left X

getLeftY

public int getLeftY()
Used to get the left of the y

Returns:
the left y

getBottomX

public int getBottomX()
Used to get the bottom of the x

Returns:
the bottom x

getBottomY

public int getBottomY()
Used to get the bottom y

Returns:
the bottom y

getTopX

public int getTopX()
Used to get the top x

Returns:
the top x

getTopY

public int getTopY()
Used to get the top y

Returns:
the top y

getOX

public int getOX()
Used to get the orignal x

Returns:
the orignal x

getOY

public int getOY()
Used to get the orignal y

Returns:
the orignal y

setCount

public void setCount(int c)
Used to set the count

Parameters:
c - - used to set the counter

getCount

public int getCount()
Used to get the count

Returns:
- gets the counter

setDirection

public void setDirection(java.lang.String l)
Used to set the direction

Parameters:
l - - used to set the direction of the AI attack

getDirection

public java.lang.String getDirection()
Used to get the direction for the AIattack

Returns:
returns the direction stored for the AIAttack