A B C D E G H I M N P R S T

A

add(Ship) - Method in class ShipList
Adds a ship to this list.
AI - Class in <Unnamed>
The AI that will be running the computer player
AI() - Constructor for class AI
Defqault constructor.
AI(int) - Constructor for class AI
Contructor for tweaking the intelligence of the AI.
allShipsSunk() - Method in class Board
This method returns true if all ships on the board have been sunk, and it returns false otherwise.
allShipsSunk() - Method in class ShipList
 

B

Board - Class in <Unnamed>
Represents the board .
Board(int, int) - Constructor for class Board
This constructor for the Board object should initialize the board, setting its x and y dimensions to the given values and initializing the cells and shiplist to their initial states.
BOARD_X_COORDINATE - Static variable in class Game
 
BOARD_Y_COORDINATE - Static variable in class Game
 

C

Cell - Class in <Unnamed>
 
Cell() - Constructor for class Cell
Default constructor.
clearBoard() - Method in class Board
This method intializes the cell array and ship list references.
containsShip(int, int) - Method in class ShipList
Returns the ship present at the requested co-ordinates.

D

DEFAULT_NUMBER_OF_SHIPS - Static variable in class Game
 
Descriptions - Class in <Unnamed>
Contains the name and corresponding lengths of all the types of ships valid in this game.
Descriptions() - Constructor for class Descriptions
 
displayResult(int) - Static method in class Parser
Displays the result of a shot fired.

E

extractShipType(String) - Static method in class Descriptions
 

G

Game - Class in <Unnamed>
The class which initiates the game.
Game() - Constructor for class Game
 
generateRandomBoard(int) - Method in class Board
This method resets the board to a new state containing the number of ships given by the numberOfShips parameter.
getCellAt(int, int) - Method in class Board
Given the x and y coordinates of a cell in the board, this method returns a reference to the cell at that position (x,y).
getHits() - Method in class Ship
Get the Hits value.
getIntro() - Method in class AI
returns an introduction string.
getIntro() - Method in class Human
Returns an introduction string.
getIsHit() - Method in class Cell
returns whether this cell has been hit.
getIsHorizontal() - Method in class Ship
Get the IsHorizontal value.
getLength() - Method in class Ship
Get the Length value.
getLocation() - Static method in class Parser
Gets a location from the user and returns it to the client.
getName() - Method in class AI
Returns the name based on intelligence of the AI.
getName() - Method in class Human
 
getName() - Method in class Ship
Get the Name value.
getNextShipName() - Static method in class Descriptions
 
getNextShot() - Method in class AI
Gets the next target.
getNextShot() - Method in class Human
Returns the next target.
getPronoun() - Method in class AI
Returns a pronoun.
getPronoun() - Method in class Human
 
getShip(int) - Method in class Board
Given an integer index to a ship in the ship list, this method returns the ship at the requested index.
getShip(int) - Method in class ShipList
 
getShipAdjective() - Static method in class Descriptions
 
getShipCount() - Method in class ShipList
Returns the number of ships in the list.
getShipLength(String) - Static method in class Descriptions
 
getShipLocation() - Static method in class Descriptions
 
getShipNumber(Ship) - Method in class Board
Given a reference to a ship in the ship list, this method returns the integer index of the given ship in the list.
getShipNumber(Ship) - Method in class ShipList
 
getShipOnCell() - Method in class Cell
returns the instance of the ship on this cell.
getShipType() - Static method in class Descriptions
 
getXPosition() - Method in class Ship
Get the XPosition value.
getYPosition() - Method in class Ship
Get the YPosition value.

H

hasPoint(int, int) - Method in class Ship
Returns true if the ship is present at point x,y.
hit() - Method in class Ship
This method signifies a hit on the ship object,
Human - Class in <Unnamed>
Represetns the human player in the game.
Human() - Constructor for class Human
 

I

isSunk() - Method in class Ship
Returns true if the ship is sunk.
isValidBoard() - Method in class Board
This method returns true if the board configuration is valid, and it returns false otherwise.

M

main(String[]) - Static method in class Game
The main program.
MapPrinter - Class in <Unnamed>
 
MapPrinter() - Constructor for class MapPrinter
 
MISSED - Static variable in class Board
A state to represent one of several possible states for a Cell object

N

NOT_SHOT_AT - Static variable in class Board
A state to represent one of several possible states for a Cell object

P

Parser - Class in <Unnamed>
 
Parser() - Constructor for class Parser
 
placeOwnShips() - Static method in class Parser
Asks the user if he wants to place own ships.
placeShip(Ship) - Method in class Board
This method places the given ship (aShip) on the board by marking each cell that the ship occupies (with a call to setShipOnCell) and then by adding the ship to the shipList.
placeShips(ShipList) - Method in class Board
This method takes a ShipList object as a parameter.
print(Board) - Method in class AI
Prints the player's board.
print(Board) - Method in class Human
Prints out the board.
print() - Method in class ShipList
 
printBoardForOpponent(String, Board) - Static method in class MapPrinter
Prints the board for the opponent.
printBoardForPlayer(String, Board) - Static method in class MapPrinter
Prints the board for the player
printForOpponent(Board) - Method in class AI
 
printForOpponent(Board) - Method in class Human
Prints out the board.
printShipList() - Method in class Board
Prints the ship list by calling the print method of the ship list.
printShipList(Board) - Static method in class MapPrinter
Prints the ships present on this board.
processShot(int, int) - Method in class Board
This method processes a shot fired at cell x,y.

R

rand - Static variable in class Game
 
reportStatus(int) - Method in class AI
Uses parser to display the status
reportStatus(int) - Method in class Human
Reports the status of the last shot.

S

SAME_TARGET - Static variable in class Board
A state to represent one of several possible states for a Cell object
setHits(int) - Method in class Ship
Set the Hits value.
setIsHit(boolean) - Method in class Cell
Marks this cell as hit if flag is true.
setIsHorizontal(boolean) - Method in class Ship
Set the IsHorizontal value.
setLength(int) - Method in class Ship
Set the Length value.
setName(String) - Method in class Ship
Set the Name value.
setShipOnCell(Ship) - Method in class Cell
sets an instance of ship on this cell.
setupBoard(int, int) - Method in class AI
Sets up the board based on the inputs
setupBoard(int, int) - Method in class Human
Sets up the board for the human.
setupBoard() - Static method in class Parser
This method sets up the board.
setXPosition(int) - Method in class Ship
Set the XPosition value.
setYPosition(int) - Method in class Ship
Set the YPosition value.
Ship - Class in <Unnamed>
This class denotes a ship object.
Ship() - Constructor for class Ship
Default constructor for a ship object.
Ship(String, int, int, int, boolean) - Constructor for class Ship
Contructor for a ship
SHIP_HIT - Static variable in class Board
A state to represent one of several possible states for a Cell object
SHIP_SUNK - Static variable in class Board
A state to represent one of several possible states for a Cell object
ShipList - Class in <Unnamed>
Contains the list of ships present in a board.
ShipList() - Constructor for class ShipList
 

T

toString() - Method in class Ship
Returns a string representing the ship.

A B C D E G H I M N P R S T