org.pilotix.common
Class Ship
java.lang.Object
org.pilotix.common.PilotixElement
org.pilotix.common.Ship
- All Implemented Interfaces:
- Transferable
- Direct Known Subclasses:
- ClientShip, ServerShip
public class Ship
- extends PilotixElement
- implements Transferable
Contient les informations relatives à un Vaisseau. Ship est spécialisée en
ServerShip pour le serveur et en ClientShip pour le client.
Contient également les méthodes d'encapsulation pour les transfert sur le
réseau
| Octet 0 | Octet1 | Octet2 | Octet3-4 | Octet5-6 | Octet7 |
| 1 Octet | 1 Octet | 1 Octet | 2Octets | 2Octets | 1 Octet |
|flag SHIP| id |states | X | Y |Direction|
Method Summary |
Angle |
getDirection()
Retrieves the direction of the Ship. |
int |
getId()
|
int |
getRadius()
|
void |
read(MessageHandler mh)
Met à jour l'objet à partir d'une chaîne d'octets recupéré via un
messageHandler |
void |
set(Ship aShip)
Sets the caracteristique(direction, position) of the Ship. |
void |
setId(int anId)
|
void |
write(MessageHandler mh)
envoie des octets représentant l'objet par le bié d'un messageHandler |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ADD
public static final int ADD
- See Also:
- Constant Field Values
REMOVE
public static final int REMOVE
- See Also:
- Constant Field Values
NULL
public static final int NULL
- See Also:
- Constant Field Values
HIT
public static final int HIT
- See Also:
- Constant Field Values
ACCELERATING
public static final int ACCELERATING
- See Also:
- Constant Field Values
speed
protected Vector speed
direction
protected Angle direction
radius
protected int radius
Ship
public Ship()
Ship
public Ship(Ship aShip)
set
public void set(Ship aShip)
- Sets the caracteristique(direction, position) of the Ship.
- Parameters:
aShip
- where only pos and dir while be copied.
setId
public void setId(int anId)
getId
public int getId()
- Overrides:
getId
in class PilotixElement
getRadius
public int getRadius()
getDirection
public Angle getDirection()
- Retrieves the direction of the Ship.
- Returns:
- the current direction of the Ship
read
public void read(MessageHandler mh)
- Description copied from interface:
Transferable
- Met à jour l'objet à partir d'une chaîne d'octets recupéré via un
messageHandler
- Specified by:
read
in interface Transferable
write
public void write(MessageHandler mh)
throws java.lang.Exception
- Description copied from interface:
Transferable
- envoie des octets représentant l'objet par le bié d'un messageHandler
- Specified by:
write
in interface Transferable
- Throws:
java.lang.Exception
Pilotix 2003-2013 - Stilisto : G.C.