|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsv.Game
The game itself; contains the field, ammo and player information.
Field Summary | |
static int |
F_ERROR
|
static int |
HIT
field contains a ship, which was hit. |
static int |
MISS
field contains a miss (tried to hit ...) |
static int |
SEA
field contains sea (maybe undiscovered or a sea field on own side) |
static int |
SHIP
field contains a ship (on own side) |
Constructor Summary | |
Game()
|
Method Summary | |
int |
getAmmo()
... |
java.lang.String |
getName()
get player name |
boolean |
getReady()
used while syncronizing the game with other instance |
void |
gotResult(int x,
int y,
int z)
signalize result achieved from other instance. change status of field to given constant (process hit, if necessary) |
int |
gotShot(int x,
int y)
signalize that we got shot ... process coordinates a return result |
void |
setAmmo(int a)
set ammo (also at beginning!) |
void |
setName(java.lang.String n)
set player name |
void |
setNetDaemon(NetDaemon nd)
set network daemon (to shorten communication routes) |
void |
setReady(boolean r)
used while syncronizing the game with other instance |
void |
setShips()
set ships on own field. |
void |
setView(View v)
set view of the game (to shorten communication routes) |
int |
shoot(int x,
int y)
try to shoot at field with given coords |
void |
updateScoreBoard()
communicate with an update the score board to the actual values. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int F_ERROR
public static final int SEA
public static final int MISS
public static final int HIT
public static final int SHIP
Constructor Detail |
public Game()
Method Detail |
public void setName(java.lang.String n)
n
- public java.lang.String getName()
public void setAmmo(int a)
a
- public int getAmmo()
public void setReady(boolean r)
r
- ready or notpublic boolean getReady()
public void setNetDaemon(NetDaemon nd)
nd
- public void setView(View v)
v
- public int shoot(int x, int y)
x
- y
-
public int gotShot(int x, int y)
x
- x coordy
- y coord
public void gotResult(int x, int y, int z)
x
- x coordy
- y coordz
- final corresponding to game's finals.public void setShips()
public void updateScoreBoard()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |