public void PressButton() { if (_door.IsOpen()) { _door.Close(); return; } _door.Open(); System.Console.WriteLine("Door is opened!"); }
public void Recognize(Bark bark) { Console.WriteLine("Bark Recognizer:Heard a '" + bark.Sound + "'"); List <Bark> allowedbarks = _door.AllowedBark; foreach (Bark allowedbark in allowedbarks) { if (allowedbark.Equals(bark)) { _door.Open(); return; } } Console.WriteLine("Sorry this dog is not allowed"); }