Beispiel #1
0
        private void GetEventData()
        {
            MethodInfo[] eventList = typeof(EventFunctions).GetMethods();

            foreach (MethodInfo currentEvent in eventList)
            {
                if (currentEvent.ReturnType == typeof(void))
                {
                    Event.EventDelegate currentEventDelegate = (Event.EventDelegate)Delegate.CreateDelegate(typeof(Event.EventDelegate), player, currentEvent);

                    events.Add(new Event(currentEventDelegate));
                }
            }

            events.Shuffle();
        }
Beispiel #2
0
 public void Subscribe(Event e, Event.EventDelegate d, bool oneShot = false) => e.Subscribe(this, d, oneShot);