Package robocode

Class Condition

    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String name
      The name of this condition.
      int priority
      The priority of this condition.
    • Constructor Summary

      Constructors 
      Constructor Description
      Condition()
      Creates a new, unnamed Condition with the default priority, which is 80.
      Condition​(java.lang.String name)
      Creates a new Condition with the specified name, and default priority, which is 80.
      Condition​(java.lang.String name, int priority)
      Creates a new Condition with the specified name and priority.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void cleanup()
      Called by the system in order to clean up references to internal objects.
      java.lang.String getName()
      Returns the name of this condition.
      int getPriority()
      Returns the priority of this condition.
      void setName​(java.lang.String newName)
      Sets the name of this condition.
      void setPriority​(int newPriority)
      Sets the priority of this condition.
      abstract boolean test()
      Overriding the test() method is the point of a Condition.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • priority

        public int priority
        The priority of this condition. Defaults to 80.
      • name

        public java.lang.String name
        The name of this condition.
    • Constructor Detail

      • Condition

        public Condition()
        Creates a new, unnamed Condition with the default priority, which is 80.
      • Condition

        public Condition​(java.lang.String name)
        Creates a new Condition with the specified name, and default priority, which is 80.
        Parameters:
        name - the name for the new Condition
      • Condition

        public Condition​(java.lang.String name,
                         int priority)
        Creates a new Condition with the specified name and priority. A condition priority is a value from 0 - 99. The higher value, the higher priority. The default priority is 80.
        Parameters:
        name - the name for the new condition
        priority - the priority of the new condition
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the name of this condition.
        Returns:
        the name of this condition
      • getPriority

        public final int getPriority()
        Returns the priority of this condition. A condition priority is a value from 0 - 99. The higher value, the higher priority. The default priority is 80.
        Returns:
        the priority of this condition
      • setName

        public void setName​(java.lang.String newName)
        Sets the name of this condition.
        Parameters:
        newName - the new name of this condition
      • setPriority

        public void setPriority​(int newPriority)
        Sets the priority of this condition. A condition priority is a value from 0 - 99. The higher value, the higher priority. The default priority is 80.
        Parameters:
        newPriority - the new priority of this condition.
      • cleanup

        public void cleanup()
        Called by the system in order to clean up references to internal objects.
        Since:
        1.4.3