make Trigger and Queue methods generic to carry through full event type

Or at least, to carry it through without having to do a GetType() when
needed when we are freeing the event in the object pool.
This commit is contained in:
Gered 2013-09-01 08:21:09 -04:00
parent b5fd222063
commit df2b49647c

View file

@ -85,7 +85,7 @@ namespace Blarg.GameFramework.Events
return false; return false;
} }
public bool Trigger(Event e) public bool Trigger<T>(T e) where T : Event
{ {
if (e == null) if (e == null)
throw new ArgumentNullException("e"); throw new ArgumentNullException("e");
@ -121,7 +121,7 @@ namespace Blarg.GameFramework.Events
return result; return result;
} }
public bool Queue(Event e) public bool Queue<T>(T e) where T : Event
{ {
if (e == null) if (e == null)
throw new ArgumentNullException("e"); throw new ArgumentNullException("e");