Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
            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);
            }
Exemplo n.º 3
0
 public record Operation(ModifyChanceType Type, Farmer Target);