Exemplo n.º 1
0
 public override void UnregisterListener(EventListener listener)
 {
     if (listener is OnDungeonChanged)
     {
         changedEvent -= new OnModelChanged(((OnDungeonChanged)listener).OnModelChanged);
     }
     if (listener is OnBackPackChanged)
     {
         packChangedEvent -= new OnPackChanged(((OnBackPackChanged)listener).OnModelChanged);
     }
 }
Exemplo n.º 2
0
    public override void RegisterListener(EventListener listener)
    {
        if (listener is OnDungeonChanged)
        {
            var listen = (OnDungeonChanged)listener;
            changedEvent += new OnModelChanged(listen.OnModelChanged);
            listen.OnModelChanged(_currentDungeon);
        }

        if (listener is OnBackPackChanged)
        {
            var listen = (OnBackPackChanged)listener;
            packChangedEvent += new OnPackChanged(listen.OnModelChanged);
            listen.OnModelChanged(_currentBackpack);
        }
    }