Exemplo n.º 1
0
 /**
  * Returns the priority of events belonging to a specific class.
  *
  * @param eventClass is a string with the full class name of the event type to get the priority
  *     from.
  * @return the event priority of the specified event class.
  * @see robocode.Event#getPriority()
  */
 public int getEventPriority(String eventClass) {
   if (eventClass == null) {
     return -1;
   }
   final Event event = eventNames.get(eventClass);
   if (event == null) {
     return -1;
   }
   return event.getPriority();
 }
Exemplo n.º 2
0
 /**
  * Sets the event priority of events belonging to a specific class.
  *
  * @param eventClass is a string with the full class name of the event type to set the priority
  *     for.
  * @param priority is the new priority
  */
 public void setEventPriority(String eventClass, int priority) {
   if (eventClass == null) {
     return;
   }
   final Event event = eventNames.get(eventClass);
   if (event == null) {
     robotProxy.println("SYSTEM: Unknown event class: " + eventClass);
     return;
   }
   if (HiddenAccess.isCriticalEvent(event)) {
     robotProxy.println("SYSTEM: You may not change the priority of a system event.");
   }
   HiddenAccess.setEventPriority(event, priority);
 }