Example #1
0
    protected virtual void OnAttachedToHand(Hand hand)
    {
        ChannelSwitcher switcher = hand.GetComponent <ChannelSwitcher>();

        if (switcher != null)
        {
            switcher.radio = this;
        }
        playerIsHolding = true;
        if (batteryCharge > 0)
        {
            changeChannel();
        }
    }
        public TV()
        {
            ChannelSwitcher.TrySwitching(0);
            if (!(ChannelSwitcher is IParentalControl parentalControl))
            {
                throw new ApplicationException("Parental control is expected to be integrated within Channel Switcher!");
            }

            parentalControl.Add(new List <Channel> {
                new Channel(41), new Channel(69), new Channel(111)
            });
            const string lastPassword = "******";

            parentalControl.Set(lastPassword);
        }
        public TV()
        {
            PictureSettings.Switch(new Sports());
            PictureSettings.SetBrightness(50);
            PictureSettings.SetSharpness(50);
            PictureSettings.SetContrast(50);

            ChannelSwitcher.TrySwitching(0);
            if (!(ChannelSwitcher is IParentalControl parentalControl))
            {
                throw new ApplicationException("Parental control is expected to be integrated within Channel Switcher!");
            }

            parentalControl.Add(new List <Channel> {
                new Channel(41), new Channel(69), new Channel(111)
            });
            const string lastPassword = "******";

            parentalControl.Set(lastPassword);
        }
Example #4
0
        public void RestoreState()
        {
            // TODO: Read last state from memory. State is a subset of all settings, so values are hard-coded just for demo.
            Volume.Restore(new Volume(15));
            ChannelSwitcher.TrySwitchingTo(0);

            if (!(ChannelSwitcher is IParentalControl parentalControl))
            {
                throw new ApplicationException("Parental control is expected to be integrated within Channel Switcher!");
            }

            parentalControl.Add(new List <Channel> {
                new Channel(41), new Channel(69), new Channel(111)
            });
            const string lastPassword = "******";

            parentalControl.Set(lastPassword);

            // TODO: It will already have changed state like (Brightness == 50, Subtitle of FR language etc.)
            var savedSettings = new Settings();

            Settings = savedSettings;
        }
Example #5
0
 public virtual void ToFactorySettings()
 {
     ChannelSwitcher.Reset();
     Volume.Reset();
     TimeManager.Reset();
 }