Esempio n. 1
0
 public void DoSupport(Trouble trouble)
 {
     if (Resolve(trouble))
     {
         Done(trouble);
     }
     else if (next != null)
     {
         next.DoSupport(trouble);
     }
     else
     {
         Fail(trouble);
     }
 }
Esempio n. 2
0
 public void SupportTrouble(Trouble trouble)
 {
     if (Resolve(trouble))
     {
         Console.WriteLine("問題" + trouble.Number + "は" + _name + "が解決しました。");
     }
     else if (_next != null)
     {
         _next.SupportTrouble(trouble);
     }
     else
     {
         Console.WriteLine("問題" + trouble.Number + "は現在のサポート体制では解決できませんでした。");
     }
 }
Esempio n. 3
0
 override public bool Resolve(Trouble trouble)
 {
     return(false);
 }
 public override bool Resolve(Trouble trouble)
 {
     return(trouble.Number == number);
 }
 public override bool Resolve(Trouble trouble)
 {
     return(trouble.Number % 2 == 1);
 }
 public override bool Resolve(Trouble trouble)
 {
     return(trouble.Number < limit);
 }
Esempio n. 7
0
 protected void Fail(Trouble trouble)
 {
     Console.WriteLine(trouble + " cannot be resolved.");
 }
Esempio n. 8
0
 protected void Done(Trouble trouble)
 {
     Console.WriteLine(trouble + " is resolved by " + this + ".");
 }
Esempio n. 9
0
 protected abstract bool Resolve(Trouble trouble);
Esempio n. 10
0
 abstract public bool Resolve(Trouble trouble);