Drag[en]gine Script Module DragonScript  1.3
Dragengine.Utils.GlobalEvents.BlockListener Class Reference

Listener Implementation calling code block. More...

Inheritance diagram for Dragengine.Utils.GlobalEvents.BlockListener:
Dragengine.Utils.GlobalEvents.Listener

Public Member Functions

void addListener (String event, Block ablock)
 Add block as listener for event if not added already. More...
 
void addListener (String event, Listener listener)
 Add listener for event. More...
 
BlockListener new ()
 Create global events. More...
 
BlockListener new (Block ablock)
 Create block listener. More...
 
void removeListener (String event, Listener listener)
 Remove listener from event. More...
 
void sendEvent (String event)
 Send event. More...
 
void sendEvent (String event, Object source)
 Send event. More...
 
void setBlock (Block ablock)
 Set code block. More...
 
- Public Member Functions inherited from Dragengine.Utils.GlobalEvents.Listener
void onEvent (Object source, Object data)
 Event fired. More...
 

Detailed Description

Listener Implementation calling code block.

Code block receives two Object type parameters. The first parameter is the source sending the event and the second parameter the optional event data.

Member Function Documentation

◆ addListener() [1/2]

void Dragengine.Utils.GlobalEvents.BlockListener.addListener ( String  event,
Block  ablock 
)

Add block as listener for event if not added already.

Code block receives two Object type parameters. The first parameter is the source sending the event and the second parameter the optional event data.

Adding a block listener creates an instance of BlockListener internally. For this reason you can not remove a block listener. If you need to remove block listeners create an instance of BlockListener yourself and add it.

It is save to add listener while event is in progress of being send.

◆ addListener() [2/2]

void Dragengine.Utils.GlobalEvents.BlockListener.addListener ( String  event,
Listener  listener 
)

Add listener for event.

It is save to add listeners while event is in progress of being send.

Exceptions
EInvalidParamListener has been already added to event.

◆ new() [1/2]

BlockListener Dragengine.Utils.GlobalEvents.BlockListener.new ( )

Create global events.

◆ new() [2/2]

BlockListener Dragengine.Utils.GlobalEvents.BlockListener.new ( Block  ablock)

Create block listener.

Code block receives two Object type parameters. The first parameter is the source sending the event and the second parameter the optional event data.

◆ removeListener()

void Dragengine.Utils.GlobalEvents.BlockListener.removeListener ( String  event,
Listener  listener 
)

Remove listener from event.

It is save to remove listeners while event is in progress of being send.

Exceptions
EInvalidParamListener is not present for event.

◆ sendEvent() [1/2]

void Dragengine.Utils.GlobalEvents.BlockListener.sendEvent ( String  event)

Send event.

Same as sendEvent(String,Object,Object) but using null as source and data.

◆ sendEvent() [2/2]

void Dragengine.Utils.GlobalEvents.BlockListener.sendEvent ( String  event,
Object  source 
)

Send event.

Same as sendEvent(String,Object,Object) but using null as data.

◆ setBlock()

void Dragengine.Utils.GlobalEvents.BlockListener.setBlock ( Block  ablock)

Set code block.

Code block receives two Object type parameters. The first parameter is the source sending the event and the second parameter the optional event data.


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