Esempio n. 1
0
 public void Exceeds <Tvalue>(Char onWhom, Tvalue minValue)
 {
     if (!typeof(Tinteraction).IsAssignableFrom(typeof(Base <bool>)))
     {
         throw new InvalidCastException($"{typeof(Tinteraction).Name} not assignable from TraitInteraction.Base<bool>, yet is being asked a yes/no.");
     }
     InteractedUpon.InteractsWith.Add(InteractedBy,
                                      (Base)System.Activator.CreateInstance(InteractionType, (Func <Trait, bool>)(tr =>
     {
         return(Operator.GreaterThan(onWhom.EffectiveScore <Tvalue>(InteractedBy as Trait <Tvalue>), minValue));
     })));
 }