Index

B C F G H K M P S T 
All Classes|All Packages

B

Battleship - Class in <Unnamed>
A console version of the classic Battleship game.
Battleship(int) - Constructor for class Battleship
Constructs a Battleship game that is ready to play.
BattleshipDriver - Class in <Unnamed>
Driver class to play the game Battleship.
BattleshipDriver() - Constructor for class BattleshipDriver
 
BOARD_SIZE - Static variable in class Battleship
The size of the game board is 10 x 10.

C

checkLocation(int, int) - Method in class Ship
Checks if this Ship is located at the current location.

F

fire(String) - Method in class Battleship
Fires a torpedo at the given location as long as there is ammunition remaining.

G

getAmmunition() - Method in class Battleship
Returns the amount of ammunition remaining.
getName() - Method in class Ship
Returns the name of this Ship.
getSize() - Method in class Ship
Returns the size of this Ship.

H

hasWon() - Method in class Battleship
Determines whether or not the player has won.
hide(ArrayList<Ship>) - Method in class Ship
Hides this Ship on the board in a random position that doesn't overlap with any of the existing the ships.

K

keepPlaying() - Method in class Battleship
Returns whether or not game play should continue.

M

main(String[]) - Static method in class BattleshipDriver
Creates an instance of the Battleship class and plays the game to completion.

P

printBoard(boolean) - Method in class Battleship
Prints the board.
printWelcome() - Method in class Battleship
Prints the game's welcome message and instructions.

S

Ship - Class in <Unnamed>
A Ship is a piece within the Battleship game.
Ship(String, int) - Constructor for class Ship
Constructs a Ship with the given name and size.
SPACE_HIT - Static variable in class Battleship
Marker indicating a space on the board has been fired upon and the result was a hit.
SPACE_MISS - Static variable in class Battleship
Marker indicating a space on the board has been fired upon and the result was a miss.
SPACE_OPEN - Static variable in class Battleship
Marker indicating a space on the board is open (i.e., has not been fired upon).

T

toString() - Method in class Ship
Returns the String representation of this Ship.
B C F G H K M P S T 
All Classes|All Packages