|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.player.GroundViewer
This class visits the items beneath a player and formats them for display in the client's ground view.
Constructor Summary | |
GroundViewer(Player player,
Predicate exclude)
Constructs a new GroundViewer |
Method Summary | |
void |
addObject(GameObject obj)
Adds an object to the list, provided it's not in the cache already. |
protected boolean |
checkAdd(GameObject obj)
Right now, we use a non-extensible method of determining visibility for the ground camera. |
boolean |
checkVisibility(GameObject obj)
Checks if the player can see the object using various visibility rules. |
java.lang.String |
getCommands(GameObject obj)
Returns a string containing the commands valid for this object, for displaying in a popup menu on the client when click on the object in inventory. |
java.util.List |
getLists()
Returns a list of arrays. |
java.util.List |
getObjects()
Returns the list of object descriptors to send to the client. |
boolean |
isExcludableSpell(GameObject obj)
Returns true if ground-view spells are off for this client, and the passed object is a spell. |
void |
setLocations(java.util.List locs)
Sets the locations this viewer wants to check. |
boolean |
shouldExclude(GameObject obj)
Returns true if the Predicate passed in to our constructor wants to exclude the object. |
void |
visit(GameObject obj)
Visits an object in the map. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GroundViewer(Player player, Predicate exclude)
player
- the playerexclude
- a Predicate that returns true if the object
should not be visible in the Ground view. Can be null.Method Detail |
public void setLocations(java.util.List locs)
public void visit(GameObject obj)
visit
in interface Visitor
obj
- a GameObject from the map to look atpublic void addObject(GameObject obj)
obj
- the object to add and create a descriptor forpublic java.util.List getObjects()
protected boolean checkAdd(GameObject obj)
obj
- a GameObject
public boolean shouldExclude(GameObject obj)
public boolean checkVisibility(GameObject obj)
public boolean isExcludableSpell(GameObject obj)
public java.util.List getLists()
public java.lang.String getCommands(GameObject obj)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |