Class Event
- java.lang.Object
-
- page.codeberg.terratactician_expandoria.bots.events.Event
-
- Direct Known Subclasses:
ChallengeTickEvent
,GameOverEvent
,TileClickedEvent
,TileStatusEvent
public abstract class Event extends java.lang.Object
Events are messages send from the game to the bot. These are used to notify the bot of changes in the game. The most prominent Event is the ChallengeTickEvent, indicating a new challenge tick has started.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Event.EventType
Type of incoming events.
-
Constructor Summary
Constructors Constructor Description Event()
abstract Event constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Event
deserialize(org.json.JSONObject json)
Deserializes an Event.Event.EventType
getEventType()
Get EventType from Event object.
-
-
-
Method Detail
-
getEventType
public Event.EventType getEventType()
Get EventType from Event object.- Returns:
- event type
-
deserialize
public static Event deserialize(org.json.JSONObject json)
Deserializes an Event. Takes a JSONObject as argument and tries to parse it. Returns null on error.- Parameters:
json
- json data- Returns:
- Event or null on error.
-
-