public class Vision
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.List |
objects
The visible objects with locations relative to the creature.
|
Constructor and Description |
---|
Vision()
Create a new Vision.
|
Modifier and Type | Method and Description |
---|---|
void |
addObject(WorldObject object)
Add a object to this Vision.
|
boolean |
contains(WorldObject object)
Test if an object is currently seen.
|
Creature[] |
getCreatures()
Get the creatures in the vision.
|
WorldObject |
getObject(int idx)
Get an objects of this Vision.
|
WorldObject[] |
getObjects()
Get the objects of this Vision.
|
boolean |
removeObject(WorldObject object)
Remove a object from this Vision.
|
void |
setObject(int idx,
WorldObject object)
Set a object to this Vision.
|
void |
setObjects(WorldObject[] objects)
Set the objects of this Vision.
|
java.lang.String |
toString()
Get a string representation of this Vision.
|
protected java.util.List objects
public WorldObject[] getObjects()
public void setObjects(WorldObject[] objects)
objects
- the value to be setpublic WorldObject getObject(int idx)
idx
- The index.public void setObject(int idx, WorldObject object)
idx
- The index.object
- a value to be addedpublic void addObject(WorldObject object)
object
- a value to be removedpublic boolean removeObject(WorldObject object)
object
- a value to be removedpublic Creature[] getCreatures()
public boolean contains(WorldObject object)
public java.lang.String toString()
toString
in class java.lang.Object