private void notSupportedWarn() { Logger.printlnToRobotsConsole("SYSTEM: We are sorry. Operation is not supported in Robocode."); }
/** * Changes the time when this event occurred. * <p> * Note that the time is equal to the turn of a battle round. * <p> * This method is intended for letting robot developers create their own event types. * It is not possible to change the time of an event after it has been added to the event * queue of the robot. * * @param newTime the time this event occurred */ public void setTime(long newTime) { if (addedToQueue) { Logger.printlnToRobotsConsole( "SYSTEM: The time of an event cannot be changed after it has been added the event queue."); } else { time = newTime; } }
/** * Hidden method for setting the priority from the game engine without checking for the 'addedToQueue' flag. * <p> * <strong>Notice:</strong> This method is called by the game engine only. * * @param newPriority the new priority of this event. */ // This method must be invisible on Robot API private void setPriorityHidden(int newPriority) { if (newPriority < 0) { Logger.printlnToRobotsConsole("SYSTEM: Priority must be between 0 and 99"); Logger.printlnToRobotsConsole("SYSTEM: Priority for " + this.getClass().getName() + " will be 0"); newPriority = 0; } else if (newPriority > 99) { Logger.printlnToRobotsConsole("SYSTEM: Priority must be between 0 and 99"); Logger.printlnToRobotsConsole("SYSTEM: Priority for " + this.getClass().getName() + " will be 99"); newPriority = 99; } priority = newPriority; }
/** * Changes the priority of this event. * An event priority is a value from 0 - 99. The higher value, the higher priority. * <p> * The default priority is 80, but varies depending on the type of event. * <p> * This method is intended for letting robot developers create their own event types. * It is not possible to change the priority of an event after it has been added to the event * queue of the robot. * * @param newPriority the new priority of this event * @see AdvancedRobot#setEventPriority(String, int) */ public final void setPriority(int newPriority) { if (addedToQueue) { Logger.printlnToRobotsConsole( "SYSTEM: The priority of an event cannot be changed after it has been added the event queue."); } else { setPriorityHidden(newPriority); } }