} // null - > infinite? public virtual void StackWith(AppliedCharacterEffect effect) // possibly virtual { Debug.Assert(this.EffectId == effect.EffectId); this.Value += effect.Value; // TODO: stack infinity or time... }
internal void ApplyEffect(AppliedCharacterEffect effect) { AppliedCharacterEffect currentEffect; if (this._appliedCharacterEffects.TryGetValue(effect.EffectId, out currentEffect)) { if (effect.ReplacePrevious) { this._appliedCharacterEffects[effect.EffectId] = effect; } else { currentEffect.StackWith(effect); } } else { this._appliedCharacterEffects.Add(effect.EffectId, effect); } }
// TODO: more props like whether is temporary or constant, where it started, link to source (if external) / feat item, when it ends... // TODO: below some proposals, but this is not finished... public void AddExtraEfect(AppliedCharacterEffect efefctBuilder) { throw new NotImplementedException(); }
internal void RemoveEffect(AppliedCharacterEffect effect) { this._appliedCharacterEffects.Remove(effect.EffectId); }