public Effect( ModifyChanceType chanceType, Func <double, double> calculate, Dictionary <Operation, List <Func <double, double> > > appliedFarmers ) { this.chanceType = chanceType; this.calculate = calculate; this.appliedFarmers = appliedFarmers ?? throw new ArgumentNullException(nameof(appliedFarmers)); }
public EffectManager( Dictionary <Operation, List <Func <double, double> > > appliedFarmers, ModifyChanceType chanceType, Action <EventHandler <TEventArgs> > register, Action <EventHandler <TEventArgs> > unregister ) { this.appliedFarmers = appliedFarmers ?? throw new ArgumentNullException(nameof(appliedFarmers)); this.chanceType = chanceType; this.unregister = unregister ?? throw new ArgumentNullException(nameof(unregister)); register(this.HandleEvent); }
public record Operation(ModifyChanceType Type, Farmer Target);