de.tud.dvs1.mmpgp2p
Class GameObject
java.lang.Object
de.tud.dvs1.mmpgp2p.GameObject
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- Avatar, CannonBall
public class GameObject
- extends java.lang.Object
- implements java.io.Serializable
Klasse zur Darstellung eines Objektes in der Welt.
Typ und Subtype können von der Implementierung verwendet werden,
um Objektklassen und deren Vertreter zu implementieren (z.B. Bäume
in verschiedenen Ausprägungen.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AVATAR_START_ID
public static final int AVATAR_START_ID
- See Also:
- Constant Field Values
AVATAR_INC
public static final int AVATAR_INC
- See Also:
- Constant Field Values
userdata
public static java.lang.Object userdata
id
protected int id
mayChange
protected boolean mayChange
x
public int x
y
public int y
z
public int z
l
public int l
w
public int w
h
public int h
orientation
public double orientation
owner
public int owner
tox
public int tox
toy
public int toy
toz
public int toz
fromx
public int fromx
fromy
public int fromy
fromz
public int fromz
type
public int type
subtype
public int subtype
speed
public double speed
name
public java.lang.String name
life
public int life
maxlife
public int maxlife
lastcommand
public long lastcommand
lastupdate
public long lastupdate
GameObject
protected GameObject(int oid)
GameObject
public GameObject(GameWorld g)
throws MmpgP2PException
- Ein neues Objekt wird erzeugt.
- Throws:
MmpgP2PException
isAvatar
public boolean isAvatar()
mayChangeRegion
public boolean mayChangeRegion()
getID
public int getID()
getLife
public int getLife()
isMoving
public boolean isMoving()
- Is das Objekt in Bewegung?
hit
public int hit(int h)
- Objekt wird getroffen und erhält Schaden.
- Returns:
- Die tatsächliche Menge des Schaden, den dieses Objekt erhalten hat.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object