## XIDPawn
Class XIIIDispatcher

source: C:\XIII\XIDPawn\Classes\XIIIDispatcher.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Triggers
             |
             +--XIII.XIIITriggers
                |
                +--XIDPawn.XIIIDispatcher

Direct Known Subclasses:None

class XIIIDispatcher
extends XIII.XIIITriggers

    //=============================================================================
    // XIIIDispatcher: recoi 1 trigger (qui correspond a son nom) en entree, et active
    //un set d'event avec des delais optionnels
    //=============================================================================

Variables
`float` | `OutDelays[8]` Delai avant declenchement des events.
`name` | `OutEvents[8]` Events a genere
`bool` | `bTriggerOnceOnly` Delai avant declenchement des events.
`int` | `i` Delai avant declenchement des events.

States
Fin

Function Summary
`void` | `Trigger(Actor Other, Pawn EventInstigator)`
    //____________________________________________________________________
    // When dispatcher is triggered...
`void` | `UnTrigger(Actor Other, Pawn EventInstigator)`
    //____________________________________________________________________
    // When dispatcher is Untriggered...

State Fin Function Summary
`void` | `UnTrigger(Actor Other, Pawn EventInstigator)`
`void` | `Trigger(Actor Other, Pawn EventInstigator)`

Source Code

    00001	//=============================================================================
    00002	// XIIIDispatcher: recoi 1 trigger (qui correspond a son nom) en entree, et active
    00003	//un set d'event avec des delais optionnels
    00004	//=============================================================================
    00005	class XIIIDispatcher extends XIIITriggers;
    00006
    00007
    00008	//-----------------------------------------------------------------------------
    00009	// Dispatcher variables.
    00010
    00011	var() name  OutEvents[8]; // Events a genere
    00012	var() float OutDelays[8]; // Delai avant declenchement des events.
    00013	var() bool bTriggerOnceOnly;
    00014	var int i;
    00015
    00016
    00017	//____________________________________________________________________
    00018	// When dispatcher is triggered...
    00019	function Trigger( actor Other, pawn EventInstigator )
    00020	{
    00021		Instigator = EventInstigator;
    00022		gotostate('Dispatch');
    00023	}
    00024
    00025	//____________________________________________________________________
    00026	// When dispatcher is Untriggered...
    00027	function UnTrigger( actor Other, pawn EventInstigator )
    00028	{
    00029		Instigator = EventInstigator;
    00030		gotostate('UnDispatch');
    00031	}
    00032
    00033	//____________________________________________________________________
    00034	// Dispatch events.
    00035	state() Dispatch
    00036	{
    00037		ignores Trigger,UnTrigger;
    00038
    00039	Begin:
    00040		for( i=0; i<ArrayCount(OutEvents); i++ )
    00041		{
    00042			if( (OutEvents[i] != '') && (OutEvents[i] != 'None') )
    00043			{
    00044				Sleep( OutDelays[i] );
    00045				TriggerEvent(OutEvents[i],self,Instigator);
    00046			}
    00047		}
    00048		if (bTriggerOnceOnly)
    00049		   GotoState('fin');
    00050		else
    00051		   GotoState('');
    00052	}
    00053
    00054	//____________________________________________________________________
    00055	// Dispatch events.
    00056	state() UnDispatch
    00057	{
    00058		ignores Trigger,Untrigger;
    00059
    00060	Begin:
    00061		for( i=0; i<ArrayCount(OutEvents); i++ )
    00062		{
    00063			if( (OutEvents[i] != '') && (OutEvents[i] != 'None') )
    00064			{
    00065				Sleep( OutDelays[i] );
    00066				UnTriggerEvent(OutEvents[i],self,Instigator);
    00067			}
    00068		}
    00069		if (bTriggerOnceOnly)
    00070		   GotoState('fin');
    00071		else
    00072		   GotoState('');
    00073	}
    00074
    00075	//____________________________________________________________________
    00076	state Fin
    00077	{
    00078	  function Trigger( actor Other, pawn EventInstigator );
    00079	  function UnTrigger( actor Other, pawn EventInstigator );
    00080	}
    00081
    00082
    00083
    00084	defaultproperties
    00085	{
    00086	}

End Source Code