﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2.Bridge
{
    internal class Radio : Device
    {
        int volume = 50;
        Boolean enabled = false;
        public Radio()
        {
        }
        public void decreaseVolume()
        {
            if (enabled && volume > 0)
                volume-=5;
            if (volume < 0)
                volume = 0;
        }

        public void disable()
        {
            enabled = false;
        }

        public void enable()
        {
            enabled = true;
        }

        public int getVolume()
        {
            return volume;
        }

        public void increseVolume()
        {
            if (enabled && volume < 100)
                volume+=5;
            if (volume > 100)
                volume = 100;
        }

        public bool isEnabled()
        {
            return enabled;
        }
    }
}
