AI for Games 1.1.1
Loading...
Searching...
No Matches
game2dai.fsm.Dispatcher Class Reference

Public Member Functions

void deleteAllTelegrams ()
 

Static Public Member Functions

static void dispatch (long delay_ms, int sender, int receiver, int msg, Object ... eInfo)
 
static void update ()
 

Static Private Member Functions

static void sendTelegram (int receiver, Telegram tgram)
 

Static Private Attributes

static TreeSet< Telegramtelegrams = new TreeSet<Telegram>()
 

Detailed Description

This class is responsible for storing and dispatching messages between entities

Author
Peter Lager

Member Function Documentation

◆ deleteAllTelegrams()

void game2dai.fsm.Dispatcher.deleteAllTelegrams ( )

Remove all outstanding telegrams - useful if reseting a game or simulation

◆ dispatch()

static void game2dai.fsm.Dispatcher.dispatch ( long  delay_ms,
int  sender,
int  receiver,
int  msg,
Object ...  eInfo 
)
static

Dispatch a telegram to another entity with optional delay and any extra information supplied

Parameters
delay_msthe delay (in milliseconds) before the telegram is to be sent
senderthe ID of the entity sending the message
receiverthe ID of the entity to receive the telegram
msgunique integer identifying the message
eInfoadditional information as required - the receiver will know what there is.

◆ update()

static void game2dai.fsm.Dispatcher.update ( )
static

Called by the world update - will send any telegrams ready for processing

Member Data Documentation

◆ telegrams

TreeSet<Telegram> game2dai.fsm.Dispatcher.telegrams = new TreeSet<Telegram>()
staticprivate

The set of telegrams still to be processed.


The documentation for this class was generated from the following file: