public void RemoveCondition(Condition condition) { // TODO: BUG - Condition is somehow removed before being able to check if it exists??? if (!_conditions.Contains(condition)) { // Error here. } else { _conditions.Remove(condition); condition.Removed -= RemoveCondition; // ??? if (condition.Type == ConditionType.Paralysis || condition.Type == ConditionType.Sleep) { Current = Status.None; } if (ConditionChanged != null) { ConditionChanged.Invoke(new ConditionChangeEvent(_character, condition.Type, AddRemoveType.Remove)); } } }
void OnAggregatedStatePropertyChanged(BindableObject bindable, object oldValue, object newValue) { if ((bool)oldValue == (bool)newValue) { return; } ConditionChanged?.Invoke(bindable, (bool)oldValue, (bool)newValue); }
internal void UpdateCondition(ConditionJsonData data) { var old = conditionId; conditionId = data.Id; readableHint = data.Description; RaisePropertyChanged(nameof(Readable)); ConditionChanged?.Invoke(this, old, conditionId); }
public void AddCondition(Condition condition) { if (_conditions.Contains(condition)) { // Error here. } else { _conditions.Add(condition); condition.Removed += RemoveCondition; if (ConditionChanged != null) { ConditionChanged.Invoke(new ConditionChangeEvent(_character, condition.Type, AddRemoveType.Add)); } } }
protected void OnConditionChanged(string propertyName = null) { ConditionChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); }