|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectShip
public class Ship
George Smith CIS421 - Web Based Java December 7th, 2007 Project: Battleship v2.0 Description: The Ship class for the battle ship game that is used to store attributes about each ship
| Field Summary | |
|---|---|
private int |
active
|
private int |
hp
|
private int |
shipLength
|
private java.lang.String |
shipName
|
private java.lang.String |
shipSym
|
| Constructor Summary | |
|---|---|
Ship(int type)
The Ship class is used to setup the ship attributes and to store important information about them |
|
| Method Summary | |
|---|---|
int |
getActive()
Used to get the state of any ship |
int |
getShipHP()
Used to get the current head points of the ship requested |
int |
getShipLength()
Used to get the ship length of the ship requested |
java.lang.String |
getShipName()
Used to get the name of the ship |
void |
hpLoss()
Used to subtract headpoints for a given ship |
void |
setActive(int act)
used to set the active of a ship |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int active
private java.lang.String shipName
private int shipLength
private int hp
private java.lang.String shipSym
| Constructor Detail |
|---|
public Ship(int type)
type - - determines the type of ship to be setup| Method Detail |
|---|
public void setActive(int act)
act - - the state of the ship, 0 for being sunk and 1 for being still alivepublic int getActive()
public int getShipLength()
public java.lang.String getShipName()
public int getShipHP()
public void hpLoss()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||