public bool Remove(StatePrimitive <T> item)
 {
     if (_list.Remove(item))
     {
         item.onValueChanged -= OnElementValueChanged;
         onValueChanged?.Invoke(item, ActionType.Removed);
         return(true);
     }
     return(false);
 }
 private void OnElementValueChanged(StatePrimitive <T> element)
 {
     onValueChanged?.Invoke(element, ActionType.Updated);
 }
 public void Add(StatePrimitive <T> item)
 {
     _list.Add(item);
     item.onValueChanged += OnElementValueChanged;
     onValueChanged?.Invoke(item, ActionType.Added);
 }
Beispiel #4
0
 public void Add(TKey key, StatePrimitive <TValue> value)
 {
     _dic.Add(key, value);
     value.onValueChanged += OnElementValueChanged;
     onValueChanged?.Invoke(value, ActionType.Added);
 }