예제 #1
0
파일: RlEvHub.cs 프로젝트: toyboot4e/Rot
 public IEnumerable <RlEvent> handleAbs(RlEvent e)
 {
     Force.nonNull(e, "RlEventHub.handleAny()");
     if (!this.concHubs.TryGetValue(e.GetType(), out var concHub))
     {
         // we don't have any handler for that. think about `NotYetDecided` action
         yield break;
     }
     foreach (var ev in concHub.handleAbs(e))
     {
         yield return(ev);
     }
 }
예제 #2
0
        /// <summary> The nestable <c>RlEvent</c> handling </summary>
        static IEnumerable <RlGameProgress> processEvent(AnyRlEvHub evHub, RlEvent ev)
        {
            yield return(RlGameProgress.event_(ev));

            foreach (var evNested in evHub.handleAbs(ev))
            {
                // nest events enabled
                foreach (var report in RlGameState.processEvent(evHub, evNested))
                {
                    if (report == null)
                    {
                        continue;
                    }
                    yield return(report);
                }
            }
        }
예제 #3
0
파일: RlEvHub.cs 프로젝트: toyboot4e/Rot
 /// <summary> Downcasts give event to <c>T</c> and dispaches them to the handlers. </summary>
 IEnumerable <RlEvent> IConcRlEvHub.handleAbs(RlEvent ev) => this.handleConc(ev as T);