diff --git a/Classes/ICCME_EventBase.uc b/Classes/ICCME_EventBase.uc index 529b865..4750b3b 100644 --- a/Classes/ICCME_EventBase.uc +++ b/Classes/ICCME_EventBase.uc @@ -1,4 +1,4 @@ -class ICCME_EventBase extends Object +class ICCME_EventBase extends RelationalClasses abstract; // time the event was created (relative to game start) @@ -7,8 +7,48 @@ var float createdTime; // Tell the engine this event must be treated in the current Tick() context and not the next one var bool bUrgent; +var array _ar_AttachedEventListener; +var bool _bBroadcast; + // print Event relevent informations in the main UT log file function doLog() { log("===== Event:"@Self.Class@"["$createdTime$"]"@"====="); +} + +static function attach(ICCME_EventListenerBase EventListener) +{ + local int i; + local bool bAlreadyRegistered; + + if(EventListener.bMonitor) return; + + for(i=0;i(default.Tchilds[i]).static.attach(EventListener); + } +} + +function RunAttached() +{ + local int i; + for(i=0;i ar_UUIDBefore; var array ar_UUIDAfter; -// Init function automatically called when Listener added -function Init(); +/* User-Defined functions */ +function Init(); // Init function automatically called when Listener added +function ProcessEvent(ICCME_EventBase Event); // Main user function, to process incomming event. +function Tick(float DeltaTime); // Optionnal user Tick() function -// Main user function, to process incomming event. -function ProcessEvent(ICCME_EventBase Event); - -// Optionnal user Tick() function -function Tick(float DeltaTime); +/* User accessible API (Callable from User-Defined functions)*/ // Helper function to add new event in the process Queue -// => To be called from ProcessEvent() -function AddEvent(ICCME_Event_CustomBase Event) +function private AddEvent(ICCME_Event_CustomBase Event) { GameState.API_AddCustomPostEvent(Event); } -// Helper function to force check EndGame conditions (During OverTime) -// => To be called from ProcessEvent() -function CheckEndGame() +// Helper function to tell the engine to check EndGame conditions (Designed for OverTime) +function private CheckEndGame() { GameState.API_CheckEndGame(); } +// Attach this EventListener to an Event +function private attachEvent(class TEvent) +{ + TEvent.static.attach(Self); +}