public SpellEffectApplicationContext([NotNull] NetworkEntityGuid spellSource, [NotNull] NetworkEntityGuid applicationTarget, [NotNull] ISpellEffectPairable spellEffectData, [NotNull] IReadonlyEntityDataFieldContainer applicationTargetEntityData) { SpellSource = spellSource ?? throw new ArgumentNullException(nameof(spellSource)); ApplicationTarget = applicationTarget ?? throw new ArgumentNullException(nameof(applicationTarget)); SpellEffectData = spellEffectData ?? throw new ArgumentNullException(nameof(spellEffectData)); ApplicationTargetEntityData = applicationTargetEntityData ?? throw new ArgumentNullException(nameof(applicationTargetEntityData)); }
public ISpellEffectHandler Create([NotNull] ISpellEffectPairable context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (!SelectorMap.ContainsKey(context.SpellEffect.EffectType)) { throw new InvalidOperationException($"Cannot load Spell Effect Handler for Effect: {context.SpellEffect.SpellEffectId} in Spell: {context.Spell.SpellId}:{context.Spell.SpellName} with EffectType: {context.SpellEffect.EffectType}"); } return(SelectorMap[context.SpellEffect.EffectType]); }