|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcleoni.adv.ManageableObject
cleoni.adv.DimxObject
cleoni.adv.AdvObject
public class AdvObject
Game's base object. CHARACTER, ITEM, LINK and ROOM are AdvObjects All the common tasks and properties are here. Most of the DimX game code is here. Please see Class hierarchy of the Javadoc.
| Field Summary | |
|---|---|
Token |
capacity
|
AdvObject |
container
|
java.lang.String |
defContainer
|
Token |
facing
|
Token |
images
|
static int[] |
methodArgs
|
static java.lang.String[] |
methods
|
Token |
showfor
|
Token |
showmode
|
Token |
volume
|
| Fields inherited from class cleoni.adv.DimxObject |
|---|
contents, id, name, properties, world |
| Constructor Summary | |
|---|---|
AdvObject(World aWorld,
java.lang.String aName,
java.lang.String anId,
java.lang.String aDescription,
java.lang.String anIcon,
java.lang.String attrList,
int aCapacity,
int aVolume,
boolean setDefShowpos,
java.lang.String aDefContainer)
AdvObject constructor comment. |
|
| Method Summary | |
|---|---|
void |
afterWorldChange()
Does any final operations after world change (typically calls reset() ) |
boolean |
attachEvent(java.lang.String eventid,
java.lang.String copyfromid,
Token tcopyfrom)
Attaches and event to the current object |
boolean |
close(Character agent)
|
protected boolean |
contains(java.lang.String whatId)
|
void |
copyFacesInto(java.lang.String[] res)
|
void |
debug(java.lang.String s)
|
void |
die(boolean removeFromContainer,
int contentsPolicy)
makes internal cleaning before object destruction |
Dict |
getContents(boolean checkOpen)
|
java.lang.String |
getDescription(AdvObject agent,
DictSorted input)
|
Image |
getExactImage(java.lang.String face)
|
protected int |
getFreeSpace()
|
java.lang.String |
getIcon()
|
int |
getMethodArgs(java.lang.String mname)
|
java.lang.String[] |
getMethods()
|
java.lang.Object[] |
getNearestImage(java.lang.String face)
|
Panel |
getPanel()
|
PeopleContainer |
getPeopleContainer()
Gets the current container but checks if it is a regular "people container", that is, a Container object type. |
Room |
getRoom()
|
java.lang.String |
getType()
|
java.lang.String |
getType(boolean incSubTypes)
|
java.lang.String |
getTypePrefix()
|
protected int |
getUsedSpace()
|
boolean |
go(java.lang.String wayId)
Moves the object along a Link. |
boolean |
hasImageUrl(java.lang.String imageUrl)
|
protected boolean |
hasSeveralFaces()
|
boolean |
hear(DimxObject from,
java.lang.String msg)
|
boolean |
hide(java.lang.StringBuffer msg)
|
protected boolean |
isAccessibleFrom(AdvObject from)
|
boolean |
isHidden()
|
boolean |
isHideable()
only returns true if "hideable" exists and is true, or if "hideable" does not exist, returns true if "hidden" exists. |
boolean |
isLink()
|
boolean |
isLockable()
By default, items are NOT lockable |
boolean |
isLocked()
|
protected boolean |
isNear(java.lang.String targFullId)
|
boolean |
isOpen()
|
boolean |
isOpenable()
|
boolean |
isPeopleContainer()
|
boolean |
isPickable()
|
boolean |
isPlayer()
|
boolean |
isRobot()
|
boolean |
isVehicle()
|
java.lang.String |
listImages()
|
boolean |
moveTo(AdvObject where,
AdvObject agent,
boolean checkOpen,
boolean checkEvents)
|
boolean |
objPlace(AdvObject what,
boolean checkOpen,
AdvObject agent,
boolean checkEvents)
Places an object into this one. |
AdvObject |
objRemove(AdvObject what,
AdvObject agent,
AdvObject source,
AdvObject dest,
boolean checkOpen,
boolean checkEvents)
|
boolean |
open(Character agent)
|
void |
reset()
Resets the object in its initial position |
void |
setDescription(java.lang.String adescription)
|
void |
setFacing(java.lang.String aDirection)
|
void |
setHidden(boolean hidden)
Only works on something that is already hideable. |
void |
setHideable(boolean hideable)
Set "hideable" to the value provided. |
boolean |
setImage(java.lang.String face,
Image anImage)
sets the image for the specified face. |
void |
setLockable(boolean lockable)
set the "lockable" property to the value provided. |
void |
setLocked(boolean locked)
Only works on something that is already lockable. |
void |
setOpenable(boolean openable)
set "openable" to the value provided. |
java.lang.String |
toString()
|
Token |
varGet(java.lang.String varId,
boolean getReference)
Gets a property |
protected java.lang.String |
varGetIdAt(int i)
|
protected int |
varsCount()
|
boolean |
varsSet(java.lang.String attrlist)
|
int |
varsToHtmlTable(java.lang.StringBuffer sb,
java.lang.String title)
|
void |
worldChange(World toWorld,
java.lang.String newid,
java.lang.String defContainer)
Changes references to the world for the current object, and all its inner objects. |
| Methods inherited from class cleoni.adv.DimxObject |
|---|
display, displayRight, execMethod, getContents, getId, getName, getObjectsByName, hasMethod, isaCharacter, isanItem, isaRoom, playBackground, playSound, refreshView, sendCmd, setPanel, useView, varExists, varGetAdvObj, varGetBool, varGetDimxObj, varGetInt, varGetStr, varSet, varSet, varSet, varSet, varSet |
| Methods inherited from class cleoni.adv.ManageableObject |
|---|
varGet |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public Token capacity
public Token volume
public java.lang.String defContainer
public Token images
public Token showfor
public Token showmode
public Token facing
public AdvObject container
public static java.lang.String[] methods
public static int[] methodArgs
| Constructor Detail |
|---|
public AdvObject(World aWorld,
java.lang.String aName,
java.lang.String anId,
java.lang.String aDescription,
java.lang.String anIcon,
java.lang.String attrList,
int aCapacity,
int aVolume,
boolean setDefShowpos,
java.lang.String aDefContainer)
throws DimxException
DimxException| Method Detail |
|---|
protected boolean contains(java.lang.String whatId)
public Room getRoom()
public PeopleContainer getPeopleContainer()
public Dict getContents(boolean checkOpen)
public java.lang.String getIcon()
public void setDescription(java.lang.String adescription)
throws DimxException
DimxException
public java.lang.String getDescription(AdvObject agent,
DictSorted input)
throws DimxException
DimxExceptionprotected int getFreeSpace()
public java.lang.String getTypePrefix()
public java.lang.String getType()
public java.lang.String getType(boolean incSubTypes)
protected int getUsedSpace()
public boolean hear(DimxObject from,
java.lang.String msg)
throws DimxException
hear in class DimxObjectDimxException
public boolean hide(java.lang.StringBuffer msg)
throws DimxException
DimxExceptionprotected boolean isAccessibleFrom(AdvObject from)
public boolean isRobot()
public boolean isVehicle()
public boolean isPeopleContainer()
public boolean isPlayer()
public boolean isHidden()
public void setHidden(boolean hidden)
hidden - isHideable()public boolean isHideable()
public void setHideable(boolean hideable)
hideable - public boolean isLink()
isLink in class DimxObjectpublic boolean isLocked()
public void setLocked(boolean locked)
locked - isLockable()public boolean isLockable()
public void setLockable(boolean lockable)
lockable - protected boolean isNear(java.lang.String targFullId)
public boolean isOpen()
public boolean isOpenable()
public void setOpenable(boolean openable)
openable - public boolean isPickable()
public boolean objPlace(AdvObject what,
boolean checkOpen,
AdvObject agent,
boolean checkEvents)
throws DimxException
what - Object to be placedcheckOpen - Shall I check "open" property first?agent - Object causing the action
DimxException - any error
public boolean open(Character agent)
throws DimxException
DimxException
public boolean setImage(java.lang.String face,
Image anImage)
face - anImage -
public java.lang.String toString()
toString in class ManageableObjectpublic void setFacing(java.lang.String aDirection)
public boolean attachEvent(java.lang.String eventid,
java.lang.String copyfromid,
Token tcopyfrom)
throws DimxException
eventid - Id of the event you want the object to respond tocopyfromid - ID of the event you are copying fromtcopyfrom - Event you are copying from, incapsulated into a Token object
DimxException - in case of problems
public boolean close(Character agent)
throws DimxException
DimxExceptionpublic void copyFacesInto(java.lang.String[] res)
public void debug(java.lang.String s)
debug in class DimxObject
public void die(boolean removeFromContainer,
int contentsPolicy)
throws DimxException
removeFromContainer - Should the object be removed from its container?contentsPolicy - 0 = Drop them to floor
1 = Recurse death
2 = Keep them (warning - this may lead to inconsistent results)
DimxException - in case of problemspublic Image getExactImage(java.lang.String face)
public java.lang.String[] getMethods()
getMethods in class DimxObjectpublic int getMethodArgs(java.lang.String mname)
getMethodArgs in class DimxObjectpublic java.lang.Object[] getNearestImage(java.lang.String face)
public Panel getPanel()
public boolean go(java.lang.String wayId)
throws DimxException
wayId -
DimxExceptionpublic boolean hasImageUrl(java.lang.String imageUrl)
protected boolean hasSeveralFaces()
public AdvObject objRemove(AdvObject what,
AdvObject agent,
AdvObject source,
AdvObject dest,
boolean checkOpen,
boolean checkEvents)
throws DimxException
DimxException
public void reset()
throws DimxException
DimxException - in case of problems
public Token varGet(java.lang.String varId,
boolean getReference)
throws DimxException
DimxObject
varGet in class DimxObjectvarId - Id of the property to be foundgetReference - Do you need its reference?
DimxExceptionprotected java.lang.String varGetIdAt(int i)
protected int varsCount()
public int varsToHtmlTable(java.lang.StringBuffer sb,
java.lang.String title)
public boolean varsSet(java.lang.String attrlist)
throws DimxException
DimxExceptionpublic java.lang.String listImages()
public boolean moveTo(AdvObject where,
AdvObject agent,
boolean checkOpen,
boolean checkEvents)
throws DimxException
agent - wheres - checkOpen -
DimxException
public void worldChange(World toWorld,
java.lang.String newid,
java.lang.String defContainer)
throws DimxException
toWorld - reference to the new world this object should belong tonewid - new id that the object should have. null = get new one automatically
DimxException - in case of problems
public void afterWorldChange()
throws DimxException
DimxException - if problems
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||