public void PressButton() { Console.WriteLine("Pressing the remote control button.."); if (door.IsOpen()) { door.Close(); } else { door.Open(); } }
public void recognize(Bark bark) { Console.WriteLine(" BarkRecognizer: Heard a '" + bark.GetSound + "'"); List <Bark> allowedBarks = door.getAllowedBarks(); foreach (var bark1 in allowedBarks) { Bark allowedBark = (Bark)bark1; if (allowedBark.CheckBarkEquals(bark)) { door.Open(); return; } } Console.WriteLine("This dog is not allowed."); }
public void recognize(String bark) { Console.WriteLine("BarkRecognizer: Heard a " + bark); door.Open(); }