Mirror of Svelto.ECS because we're a fan of it
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
432B

  1. using System;
  2. namespace Svelto.Observer
  3. {
  4. public interface IObservable<DispatchType>
  5. {
  6. event Action<DispatchType> Notify;
  7. void Dispatch(DispatchType parameter);
  8. }
  9. public class Observable<DispatchType>:IObservable<DispatchType>
  10. {
  11. public event Action<DispatchType> Notify;
  12. public void Dispatch(DispatchType parameter)
  13. {
  14. Notify(parameter);
  15. }
  16. }
  17. }