org.jadv.basic
Class JAdvObject

java.lang.Object
  |
  +--org.jadv.basic.SavedObject
        |
        +--org.jadv.basic.JAdvObject
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Level, Living, Location

public class JAdvObject
extends SavedObject

This is a basic GameObject, that is used inside the game.

Author:
neitzel
See Also:
Serialized Form

Field Summary
protected  java.util.Collection _children
           
 int _description
           
 int _HeartBeatTime
           
private  EventTimerTask _HeartBeatTimerTask
           
private  java.lang.String _masterParentID
           
private  java.lang.String _oldParentID
           
private  java.lang.String _parentID
           
 int _Size
           
private  EventTimerTask _TimerTimerTask
           
 
Fields inherited from class org.jadv.basic.SavedObject
ObjMan
 
Constructor Summary
JAdvObject()
          Constructor
JAdvObject(org.jdom.Element el)
           
 
Method Summary
 void addChild(JAdvObject obj)
          Add a child-Object inside this object
 boolean canMoveIn(JAdvObject obj)
          Checks, if the object can move inside this Object
 boolean canMoveOut(JAdvObject obj)
          Checks, if the object can move out of this Object
 void create()
          Create the Object
 void destroyObject()
          Destroy this object (Object will be deleted completly!)
 void disableHeartBeat()
          disabels the HeartBeat of this object
 void enableHeartBeat()
          enables the HeartBeat of this object!
 int getDescription()
          Returns the description of the Object
 java.lang.String getMasterParentID()
          Returns the MasterParentID (The of the object, that is responible for this object!
 java.lang.String getOldParentID()
          Returns the old ParentID.
 java.lang.String getParentID()
          getParentID() Returns the ID of the parent
 int getSight()
          getSight() Returns the sight of this object
 int getSize()
          Get the size of the Object
 void HeartBeat()
          HeartBeat is the callback function of an object, that wants HeartBeats
 void init(java.util.HashMap attribs)
          Initialisation of the object!
 void removeChild(JAdvObject obj)
          Remove an Object out of the list of children
 void reset()
          Resets the object (if needed)
 void save()
          store everything inside the attributes!
static void sendPlayerEvent(java.lang.String playerID, JAdvEvent event)
          Sends an Event to a player
 void setDescription(int description)
          Sets the description of the object
 void setMasterParentID_DEEP(java.lang.String id)
          Set the MasterParentID of this and all included Objects!
 void setMasterParentID(java.lang.String id)
          Set the MasterParentID.
 void setOldParentID(java.lang.String id)
          Set the OldParentID.
 void setParentID(java.lang.String id)
          Set the if of the parent
 void setSize(int size)
          Set the size of the object
 void setTimer(long time)
          Set the timer.
 void timer()
          timer() CallBack method for timer Events
 
Methods inherited from class org.jadv.basic.SavedObject
addEvent, canBeSwapped, createAttributes, createObject, createObject, createUUID, findObject, getAttribute, getAttributes, getAutoStart, getDeveloper, getId, getIntAttribute, getIntAttribute, getName, getNext, getPrev, hexFormat, isChanged, isValid, loadObject, markChanged, markNotChanged, mergeAttributes, removeFromList, replaceObject, replaceObject, saveObject, setAttribute, setId, setIntAttribute, setName, storeAfter, swapOut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_parentID

private java.lang.String _parentID

_oldParentID

private java.lang.String _oldParentID

_masterParentID

private java.lang.String _masterParentID

_description

public int _description

_HeartBeatTime

public int _HeartBeatTime

_Size

public int _Size

_children

protected java.util.Collection _children

_HeartBeatTimerTask

private EventTimerTask _HeartBeatTimerTask

_TimerTimerTask

private EventTimerTask _TimerTimerTask
Constructor Detail

JAdvObject

public JAdvObject()
Constructor

See Also:
org.jadv.basic.SavedObject#SavedObject(String)

JAdvObject

public JAdvObject(org.jdom.Element el)
Method Detail

addChild

public void addChild(JAdvObject obj)
Add a child-Object inside this object

Parameters:
obj -

canMoveIn

public boolean canMoveIn(JAdvObject obj)
Checks, if the object can move inside this Object

Parameters:
obj -
Returns:
boolean

canMoveOut

public boolean canMoveOut(JAdvObject obj)
Checks, if the object can move out of this Object

Parameters:
obj -
Returns:
boolean

create

public void create()
Create the Object

Overrides:
create in class SavedObject
See Also:
SavedObject.create()

disableHeartBeat

public void disableHeartBeat()
disabels the HeartBeat of this object


destroyObject

public void destroyObject()
Destroy this object (Object will be deleted completly!)

Overrides:
destroyObject in class SavedObject

enableHeartBeat

public void enableHeartBeat()
enables the HeartBeat of this object!


getDescription

public int getDescription()
Returns the description of the Object

Returns:
int

getMasterParentID

public java.lang.String getMasterParentID()
Returns the MasterParentID (The of the object, that is responible for this object!

Returns:
String - the masterParentID

getOldParentID

public java.lang.String getOldParentID()
Returns the old ParentID.

Returns:
String

getParentID

public java.lang.String getParentID()
getParentID() Returns the ID of the parent

Returns:
String

getSight

public int getSight()
getSight() Returns the sight of this object

Returns:
int

getSize

public int getSize()
Get the size of the Object

Returns:
the size of the object.

HeartBeat

public void HeartBeat()
HeartBeat is the callback function of an object, that wants HeartBeats


init

public void init(java.util.HashMap attribs)
Initialisation of the object!

Overrides:
init in class SavedObject
Parameters:
attribs - - the attributes of the object

removeChild

public void removeChild(JAdvObject obj)
Remove an Object out of the list of children

Parameters:
obj -

reset

public void reset()
Resets the object (if needed)


save

public void save()
store everything inside the attributes!

Overrides:
save in class SavedObject

sendPlayerEvent

public static void sendPlayerEvent(java.lang.String playerID,
                                   JAdvEvent event)
Sends an Event to a player

Parameters:
playerID - ID of the player to send Event to
event - Event to send

setDescription

public void setDescription(int description)
Sets the description of the object

Parameters:
description -

setMasterParentID

public void setMasterParentID(java.lang.String id)
Set the MasterParentID.

Parameters:
id -

setMasterParentID_DEEP

public void setMasterParentID_DEEP(java.lang.String id)
Set the MasterParentID of this and all included Objects!

Parameters:
id -

setOldParentID

public void setOldParentID(java.lang.String id)
Set the OldParentID.

Parameters:
id -

setParentID

public void setParentID(java.lang.String id)
Set the if of the parent

Parameters:
id -

setSize

public void setSize(int size)
Set the size of the object

Parameters:
size - - the new size of the object.

setTimer

public void setTimer(long time)
Set the timer. If time == 0, then the timer will be stopped!

Parameters:
time - - time for the timer in seconds

timer

public void timer()
timer() CallBack method for timer Events