|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectCruiser
public class Cruiser
| Field Summary |
|---|
| Fields inherited from interface Ship |
|---|
EAST, NORTH, SOUTH, WEST |
| Constructor Summary | |
|---|---|
Cruiser()
|
|
| Method Summary | |
|---|---|
char |
getCharForPoint(BoardPoint strike)
Returns the character to display for a given BoardPoint. |
BoardPoint[] |
getExtent()
Returns a newly-allocated array of BoardPoints, one for each BoardPoint this Ship occupies. |
int |
getFacing()
Returns the direction this Ship is facing. |
java.lang.String |
getName()
Returns "cruiser." |
BoardPoint |
getOrigin()
Returns the origin point for this Ship. |
boolean |
isDestroyed()
Returns true if this Ship is destroyed, false otherwise. |
boolean |
occupies(BoardPoint strike)
Returns true if this Ship occupies the given space, false otherwise. |
void |
registerStrike(BoardPoint strike)
Registers the result of a strike at the given point; records the strike and possibly destroys the ship. |
void |
setFacing(int facing)
Sets the direction this ship is facing. |
void |
setOrigin(BoardPoint origin)
Sets the origin of this ship as a BoardPoint. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Cruiser()
| Method Detail |
|---|
public boolean isDestroyed()
Ship
isDestroyed in interface Shippublic java.lang.String getName()
getName in interface Shippublic boolean occupies(BoardPoint strike)
Ship
occupies in interface Shipstrike - a BoardSpace that this Ship may or may not occupy
public void registerStrike(BoardPoint strike)
Ship
registerStrike in interface Shipstrike - a BoardSpacepublic BoardPoint getOrigin()
Ship
getOrigin in interface Shippublic int getFacing()
Ship
getFacing in interface Shippublic BoardPoint[] getExtent()
Ship
getExtent in interface Shippublic char getCharForPoint(BoardPoint strike)
Ship
getCharForPoint in interface Shippublic void setOrigin(BoardPoint origin)
Ship
setOrigin in interface Shippublic void setFacing(int facing)
Ship
setFacing in interface Shipfacing - the direction this ship is facing.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||