コード例 #1
0
 private void FireEvent(BaseGameEvent theEvent)
 {
     foreach (EventReaction eventReaction in subscriberDirectory[theEvent.EventType])
     {
         eventReaction(theEvent);
     }
 }
コード例 #2
0
 public void SendEvent(BaseGameEvent theEvent)
 {
     if (subscriberDirectory.ContainsKey(theEvent.EventType))
     {
         if (theEvent.Delay == 0)
         {
             FireEvent(theEvent);
         }
         else
         {
             eventQueue.Add(currentTime + theEvent.Delay, theEvent);
         }
     }
 }