public class ExampleEvent1 extends UserDefinedEvent
Constructor and Description |
---|
ExampleEvent1() |
ExampleEvent1(java.lang.String name,
int holds)
Constructs an ExampleEvent1 event.
|
Modifier and Type | Method and Description |
---|---|
int |
getHolds()
Gets the number of holds on the ship.
|
java.lang.String |
getShipName()
Gets the name of the ship.
|
boolean |
onText(java.lang.String buffer,
java.lang.String text)
This method is called when new text has arrived from the game server.
You can override this method to handle incoming text. Text will only be received during the WaitForEvent command. |
getClassName, isEventClass, isUserDefined, printTrace, printTrace, setBufferText, skipBufferText
public ExampleEvent1()
public ExampleEvent1(java.lang.String name, int holds)
name
- The ship name.holds
- The number of holds.public java.lang.String getShipName()
public int getHolds()
public boolean onText(java.lang.String buffer, java.lang.String text) throws java.lang.Exception
UserDefinedEvent
skipBufferText
and setBufferText
methods.onText
in class UserDefinedEvent
buffer
- The current text buffer.text
- The new incoming text.true
to post this event or false
to wait.java.lang.Exception
UserDefinedEvent.skipBufferText(int)
,
UserDefinedEvent.setBufferText(java.lang.String)
,
UserDefinedEvent.printTrace(java.lang.String)