de.tud.dvs1.mmpgp2p
Class GameObject

java.lang.Object
  extended by 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

Field Summary
static int AVATAR_INC
           
static int AVATAR_START_ID
           
 int fromx
           
 int fromy
           
 int fromz
           
 int h
           
protected  int id
           
 int l
           
 long lastcommand
           
 long lastupdate
           
 int life
           
 int maxlife
           
protected  boolean mayChange
           
 java.lang.String name
           
 double orientation
           
 int owner
           
 double speed
           
 int subtype
           
 int tox
           
 int toy
           
 int toz
           
 int type
           
static java.lang.Object userdata
           
 int w
           
 int x
           
 int y
           
 int z
           
 
Constructor Summary
  GameObject(GameWorld g)
          Ein neues Objekt wird erzeugt.
protected GameObject(int oid)
           
 
Method Summary
 int getID()
           
 int getLife()
           
 int hit(int h)
          Objekt wird getroffen und erhält Schaden.
 boolean isAvatar()
           
 boolean isMoving()
          Is das Objekt in Bewegung?
 boolean mayChangeRegion()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

GameObject

protected GameObject(int oid)

GameObject

public GameObject(GameWorld g)
           throws MmpgP2PException
Ein neues Objekt wird erzeugt.

Throws:
MmpgP2PException
Method Detail

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