//TODO implement DevicesStates enums for electric devices (tv) static void Main(string[] args) { Television television = new Television(); TelevisionRemoteControl televisionRemoteControl = new TelevisionRemoteControl(); televisionRemoteControl.VolumeUp(); televisionRemoteControl.PressPowerButton(); televisionRemoteControl.SetTelevision(television); televisionRemoteControl.PressPowerButton(); televisionRemoteControl.VolumeUp(); Console.WriteLine(television.isRunning); Console.ReadLine(); }
public void SetTelevision(Television television) { this.Television = television; this.Volume = television.Volume; }
public TelevisionRemoteControl(Television television) { SetTelevision(television); }