## Gameplay
Class Dispatcher

source: C:\XIII\Gameplay\Classes\Dispatcher.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Triggers
             |
             +--Gameplay.Dispatcher

Direct Known Subclasses:None

class Dispatcher
extends Engine.Triggers

    //=============================================================================
    // Dispatcher: receives one trigger (corresponding to its name) as input,
    // then triggers a set of specifid events with optional delays.
    //=============================================================================

Variables
`float` | `OutDelays[32]` Relative delays before generating events.
`name` | `OutEvents[32]` Events to generate.
`int` | `i` Internal counter.

States
Dispatch

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

State Dispatch Function Summary

Source Code

    00001	//=============================================================================
    00002	// Dispatcher: receives one trigger (corresponding to its name) as input,
    00003	// then triggers a set of specifid events with optional delays.
    00004	//=============================================================================
    00005	class Dispatcher extends Triggers;
    00006
    00007	#exec Texture Import File=Textures\Dispatch.pcx Name=S_Dispatcher Mips=Off MASKED=1
    00008
    00009	//-----------------------------------------------------------------------------
    00010	// Dispatcher variables.
    00011
    00012	var() name  OutEvents[32]; // Events to generate.
    00013	var() float OutDelays[32]; // Relative delays before generating events.
    00014	var int i;                // Internal counter.
    00015
    00016	//=============================================================================
    00017	// Dispatcher logic.
    00018
    00019	//
    00020	// When dispatcher is triggered...
    00021	//
    00022	function Trigger( actor Other, pawn EventInstigator )
    00023	{
    00024		Instigator = EventInstigator;
    00025		gotostate('Dispatch');
    00026	}
    00027
    00028	//
    00029	// Dispatch events.
    00030	//
    00031	state Dispatch
    00032	{
    00033		ignores trigger;
    00034
    00035	Begin:
    00036		for( i=0; i<ArrayCount(OutEvents); i++ )
    00037		{
    00038			if( (OutEvents[i] != '') && (OutEvents[i] != 'None') )
    00039			{
    00040				Sleep( OutDelays[i] );
    00041				TriggerEvent(OutEvents[i],self,Instigator);
    00042			}
    00043		}
    00044		GotoState('');
    00045	}
    00046
    00047	defaultproperties
    00048	{
    00049	     Texture=Texture'Gameplay.S_Dispatcher'
    00050	}

End Source Code