com.camelspotting.jotl.event
Class OpenTTDEvent

java.lang.Object
  extended by com.camelspotting.jotl.event.OpenTTDEvent

public class OpenTTDEvent
extends Object

This class represents the events that may occur during an OpenTTD-game. NOTE: The electric rail availability may be falsely reported since it can be deactivated with a patch and such a deactivation is undetectable through communication with the server.

Version:
1.0
Author:
Mats Andreassen

Constructor Summary
OpenTTDEvent(OpenTTDEventType t, Object... objects)
          Constructor for making events.
 
Method Summary
 Object[] getObjects()
          Depending on what type of event this is this array contains different objects.
 OpenTTDEventType getType()
          This method returns the type of event.
 String toString()
          This gives a description of this event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OpenTTDEvent

public OpenTTDEvent(OpenTTDEventType t,
                    Object... objects)
Constructor for making events.

Parameters:
t - the type of event
Method Detail

getObjects

public Object[] getObjects()
Depending on what type of event this is this array contains different objects. GAME_END -> [0] is an Integer containing the year of this event GAME_START -> [0] is an Integer containing the year of this event GAME_IN_PROGRESS -> [0] is an Integer containing the year of this event NEW_LEADER -> [0] is the Company now in the lead ELECTRIC_AVAILABLE -> nothing MONORAIL_AVAILABLE -> nothing MAGLEV_AVAILABLE -> nothing COMPANY_NEW -> [0] is the Company COMPANY_REMOVED -> [0] is the removed Company PAUSED -> [0] is an Integer containing the year of this event UNPAUSED -> [0] is an Integer containing the year of this event CLIENT_JOIN -> [0] is the Client that just joined CLIENT_LEFT -> [0] is the Client that just left LOST_CONNECTION -> nothing COMPANY_REMOVED -> [0] is the Company

Returns:
an Object array of length at least 0.

getType

public OpenTTDEventType getType()
This method returns the type of event.

Returns:
the type

toString

public String toString()
This gives a description of this event.

Overrides:
toString in class Object
Returns:
the description of the type and the list of appended objects


Copyright © 2013. All Rights Reserved.