robocode
Class MessageEvent

java.lang.Object
  extended by robocode.Event
      extended by robocode.MessageEvent
All Implemented Interfaces:
Serializable, Comparable<Event>

public final class MessageEvent
extends 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:
Serialized Form

Constructor Summary
MessageEvent(String sender, Serializable message)
          Called by the game to create a new MessageEvent.
 
Method Summary
 Serializable getMessage()
          Returns the message itself.
 String getSender()
          Returns the name of the sending robot.
 
Methods inherited from class robocode.Event
compareTo, getPriority, getTime, setPriority, setTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageEvent

public MessageEvent(String sender,
                    Serializable message)
Called by the game to create a new MessageEvent.

Parameters:
sender - the name of the sending robot
message - the message for your robot
Method Detail

getSender

public String getSender()
Returns the name of the sending robot.

Returns:
the name of the sending robot

getMessage

public Serializable getMessage()
Returns the message itself.

Returns:
the message


Copyright © 2013 Robocode. All Rights Reserved.