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($"\tBarkRecognizer: heard a \"{bark}\""); var matchingBark = allowedBarks.FirstOrDefault(b => b.Equals(bark)); if (matchingBark != null) { Console.WriteLine($"\tBarkRecognizer: the \"{bark}\" bark is allowed"); door.Open(); } else { Console.WriteLine($"\tBarkRecognizer: the \"{bark}\" bark is NOT allowed"); } }