Exemple #1
0
 protected override bool Resolve(Trouble trouble)
 {
     if (trouble.GetNumber() < _limit)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemple #2
0
 public void SupportTrouble(Trouble trouble)
 {
     if (Resolve(trouble))
     {
         Done(trouble);
     }
     else if (_next != null)
     {
         _next.SupportTrouble(trouble);
     }
     else
     {
         Fail(trouble);
     }
 }
Exemple #3
0
 protected void Fail(Trouble trouble)
 {
     WriteLine($"{trouble} cannot be resolved.");
 }
Exemple #4
0
 protected void Done(Trouble trouble)
 {
     WriteLine($"{trouble} is resolved by {this}");
 }
Exemple #5
0
 protected abstract bool Resolve(Trouble trouble);
Exemple #6
0
 protected override bool Resolve(Trouble trouble)
 {
     return(false);
 }