cleoni.adv
Interface IEventProcessor

All Known Implementing Classes:
CSIEventProcessor, CustEventProcessor, DefaultCSIEventProcessor, MinionEventProcessor, PlayerEventProcessor, StartCellEventProcessor

public interface IEventProcessor

Required interface for custom fireEvent processing in Java. A custom processor of any classname wishing to handle fireEvent calls in Java must implement this interface and have a default, no argument constructor. Custom Java event handling is only attempted when no SmallBasic event handler exists. The custom processor should be defined as a WORLD attribute within the MyWorld.DXW file. Example:

 WORLD
     ...
     custEventProc   org.dimx.ACustEventProcessor
     ...
     OTHER_TAGS

     END_OTHER_TAGS

 END_WORLD
 


Method Summary
 Token execute(java.lang.String eventId, DimxObject owner, AdvObject agent, DictSorted actualpar, Token defaultResult, boolean mustExist)
          Executes special world EVENTs or custom world hook commands.
 Token fireEvent_t(java.lang.String eventId, DimxObject owner, java.lang.String agent, java.lang.String target, DictSorted params, Token defaultResult, boolean mustExist)
          Triggers an EVENT.
 boolean fireEvent(java.lang.String eventId, DimxObject owner, java.lang.String agent, java.lang.String target, DictSorted input, boolean defaultResult, boolean mustExist)
          Triggers an EVENT.
 void setWorld(World world)
          Called immediately after instantiation to provide a World reference.
 

Method Detail

setWorld

void setWorld(World world)
              throws DimxException
Called immediately after instantiation to provide a World reference.

Parameters:
world -
Throws:
DimxException

execute

Token execute(java.lang.String eventId,
              DimxObject owner,
              AdvObject agent,
              DictSorted actualpar,
              Token defaultResult,
              boolean mustExist)
              throws DimxException
Executes special world EVENTs or custom world hook commands. For example, world "restore" and "__ConsoleCommand"s can be handled here along with custom world hook commands.

Parameters:
eventId - ID of the event to be executed
owner -
agent -
actualpar -
defaultResult -
mustExist - if true, the event must exist and, if missing, a DimxException must be thrown. If false, missing event is silently tolerated
Returns:
Throws:
DimxException
See Also:
World.execute(String,DimxObject,AdvObject,DictSorted,Token,boolean)

fireEvent

boolean fireEvent(java.lang.String eventId,
                  DimxObject owner,
                  java.lang.String agent,
                  java.lang.String target,
                  DictSorted input,
                  boolean defaultResult,
                  boolean mustExist)
                  throws DimxException
Triggers an EVENT. If the EVENT is not defined, the defaultResult is returned

Parameters:
eventId -
owner -
agent -
target -
input -
defaultResult -
mustExist - if true, the event must exist and, if missing, a DimxException must be thrown. If false, missing event is silently tolerated by returning the default result.
Returns:
result of the EVENT execution
Throws:
DimxException
See Also:
World.fireEvent(String,DimxObject,String,String,DictSorted,boolean,boolean)

fireEvent_t

Token fireEvent_t(java.lang.String eventId,
                  DimxObject owner,
                  java.lang.String agent,
                  java.lang.String target,
                  DictSorted params,
                  Token defaultResult,
                  boolean mustExist)
                  throws DimxException
Triggers an EVENT. If the EVENT is not defined, the defaultResult is returned

Parameters:
eventId -
owner -
agent -
target -
params -
defaultResult -
mustExist - if true, the event must exist and, if missing, a DimxException must be thrown. If false, missing event is silently tolerated by returning the default result.
Returns:
result of the EVENT execution
Throws:
DimxException
See Also:
World.fireEvent_t(String,DimxObject,String,String,DictSorted,Token,boolean)