Exemple #1
0
 public static void ReleaseOn(this ISemaphoreInterection semaphore, IValueStateObserver <bool> source)
 {
     source.Synchronize((value) => { if (value)
                                     {
                                         semaphore.Release(source);
                                     }
                                     else
                                     {
                                         semaphore.Block(source);
                                     } });
 }
Exemple #2
0
 public static void ReleaseOn(this ISemaphoreInterection semaphore, IValueStateObserver <bool> source, Func <bool> eventValidation)
 {
     source.Synchronize(new ConditionalEventListener <bool>((value) => { if (value)
                                                                         {
                                                                             semaphore.Release(source);
                                                                         }
                                                                         else
                                                                         {
                                                                             semaphore.Block(source);
                                                                         } }, eventValidation));
 }
Exemple #3
0
 public Less(IValueStateObserver <int> variableA, IValueStateObserver <int> variableB) : base(variableA, variableB)
 {
     variableA.Synchronize((v) => _operation.Setter(v < variableB.Value), _events);
     variableB.Synchronize((v) => _operation.Setter(v > variableA.Value), _events);
 }
Exemple #4
0
 public Less(IValueStateObserver <float> variable, float constant) : base(variable, constant)
 {
     variable.Synchronize((v) => _operation.Setter(v < constant), _events);
 }
Exemple #5
0
 public Diff(IValueStateObserver <float> variableA, IValueStateObserver <float> variableB) : base(variableA, variableB)
 {
     variableA.Synchronize((v) => _operation.Setter(!Mathf.Approximately(v, variableB.Value)), _events);
     variableB.Synchronize((v) => _operation.Setter(!Mathf.Approximately(v, variableA.Value)), _events);
 }
Exemple #6
0
 public Diff(IValueStateObserver <float> variable, float constant) : base(variable, constant)
 {
     variable.Synchronize((v) => _operation.Setter(!Mathf.Approximately(v, constant)), _events);
 }
Exemple #7
0
 public Diff(IValueStateObserver <int> variable, int constant) : base(variable, constant)
 {
     variable.Synchronize((v) => _operation.Setter(v != constant), _events);
 }