Package robocode
Class MessageEvent
java.lang.Object
robocode.Event
robocode.MessageEvent
- All Implemented Interfaces:
Serializable,Comparable<Event>
A MessageEvent is sent to
onMessageReceived() when a teammate sends a message to your robot.
You can use the information contained in this event to determine what to do.- Author:
- Mathew A. Nelson (original)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMessageEvent(String sender, Serializable message) Called by the game to create a new MessageEvent. -
Method Summary
Modifier and TypeMethodDescriptionReturns the message itself.Returns the name of the sending robot.Methods inherited from class robocode.Event
compareTo, getPriority, getTime, setPriority, setTime
-
Constructor Details
-
MessageEvent
Called by the game to create a new MessageEvent.- Parameters:
sender- the name of the sending robotmessage- the message for your robot
-
-
Method Details
-
getSender
Returns the name of the sending robot.- Returns:
- the name of the sending robot
-
getMessage
Returns the message itself.- Returns:
- the message
-