|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectSpace
public class Space
George Smith CIS421 - Web Based Java December 7th, 2007 Project: Battleship v2.0 Description: The Space class for the battle ship game that is used to manage the spaces on the grid
| Field Summary | |
|---|---|
private int |
col
|
private int |
row
|
private java.lang.String |
ship
|
private java.lang.String |
status
|
| Constructor Summary | |
|---|---|
Space(int r,
int c)
Sets up the space class to store grid spot states |
|
| Method Summary | |
|---|---|
int |
getCol()
Gets the coumn number for this spot |
int |
getRow()
gets the row number for this spot |
java.lang.String |
getShip()
Gets the ship symbol for that spot |
java.lang.String |
getStatus()
Returns the status of a spot on the grid |
void |
setCol(int c)
Sets the column number for this spot |
void |
setRow(int r)
sets the row number for that spot |
void |
setShip(java.lang.String s)
Sets the ship for this spot |
void |
setStatus(java.lang.String state)
The space class is used to setup each space on teh grid and holds attributes such as what ship is on that spot, if its been hit, or a miss |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String status
private int row
private int col
private java.lang.String ship
| Constructor Detail |
|---|
public Space(int r,
int c)
r - - the row spot on the gridc - - the column spot on the grid| Method Detail |
|---|
public void setStatus(java.lang.String state)
state - - the state of the spotpublic java.lang.String getStatus()
none - - no params
public void setRow(int r)
r - - the row spot on the gridpublic int getRow()
none - - none
public void setCol(int c)
c - - the column spot on the gridpublic int getCol()
none - - no params
public void setShip(java.lang.String s)
s - - the ship symbol for this spotpublic java.lang.String getShip()
none - - no params
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||