public sealed class Warning
{
public int Level{set; get;}
public int Type{set; get;}
}
public class AudioManager
{
public void HandleWarning(Warning warning)
{
Console.WriteLine(“Play warning audio.“);
}
}
public class DisplayManager
{
public void HandleWarning(Warning warning)
{
Console.WriteLine(“Show warning picture.“);
}
}
public class WarningManager
{
private AudioManager audioManager = new AudioManager();
private DisplayManager displayManager = new DisplayManager();
private void HandleWarning(Warning warning)
{
audioManager.HandleWarning(warning);
displayManager.HandleWarning(warning);
}
}