Class Vision


  • public class Vision
    extends java.lang.Object
    Editable Java class for concept Vision of hunterprey ontology.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List objects
      The visible objects with locations relative to the creature.
    • Constructor Summary

      Constructors 
      Constructor Description
      Vision()
      Create a new Vision.
    • Field Detail

      • objects

        protected java.util.List objects
        The visible objects with locations relative to the creature.
    • Constructor Detail

      • Vision

        public Vision()
        Create a new Vision.
    • Method Detail

      • getObjects

        public WorldObject[] getObjects()
        Get the objects of this Vision. The visible objects with locations relative to the creature.
        Returns:
        objects
      • setObjects

        public void setObjects​(WorldObject[] objects)
        Set the objects of this Vision. The visible objects with locations relative to the creature.
        Parameters:
        objects - the value to be set
      • getObject

        public WorldObject getObject​(int idx)
        Get an objects of this Vision. The visible objects with locations relative to the creature.
        Parameters:
        idx - The index.
        Returns:
        objects
      • setObject

        public void setObject​(int idx,
                              WorldObject object)
        Set a object to this Vision. The visible objects with locations relative to the creature.
        Parameters:
        idx - The index.
        object - a value to be added
      • addObject

        public void addObject​(WorldObject object)
        Add a object to this Vision. The visible objects with locations relative to the creature.
        Parameters:
        object - a value to be removed
      • removeObject

        public boolean removeObject​(WorldObject object)
        Remove a object from this Vision. The visible objects with locations relative to the creature.
        Parameters:
        object - a value to be removed
        Returns:
        True when the objects have changed.
      • getCreatures

        public Creature[] getCreatures()
        Get the creatures in the vision.
      • contains

        public boolean contains​(WorldObject object)
        Test if an object is currently seen.
        Returns:
        True, if seen.
      • toString

        public java.lang.String toString()
        Get a string representation of this Vision.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation.