Ejemplo n.º 1
0
 public BatteryModel()
 {
     Name            = "";
     MaxPower        = 0;
     Capacity        = 0;
     CurrentCapacity = 0;
     State           = BatteryEnum.IDLE;
 }
Ejemplo n.º 2
0
        public BatteryModel(string n, double mp, double c, double cc)
        {
            if (n == "")
            {
                throw new ArgumentException("No name!");
            }
            else if (n == null)
            {
                throw new ArgumentNullException("No name!");
            }
            else if (mp < 0 || c < 0 || cc < 0)
            {
                throw new ArgumentException("Values must be positive!");
            }

            Name            = n;
            MaxPower        = mp;
            Capacity        = c;
            CurrentCapacity = cc;
            State           = BatteryEnum.IDLE;
        }